pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CMAKE_INSTALL_PREFIX is not configurable [WAS: Re: how to create a package installing into a separate directory?]



On 2011/10/28 09:02, norc1212 wrote:
...
I missed a paragraph on cmake configuration in the Guide
previously. Now I see there are CONFIGURE_ENV and CMAKE_ARGS.
for cmake. However no success.

To start from a clean point, I copied a simple regular
cmake-base package and tried to make it to install in its
own subdirectory:

(My sources are in /usr/src2/pkgsrc and $PREFIX is /usr/cpkg
but that should not matter.)

# cp -r devel/cppcheck local
# cd local/cppcheck
# vi Makefile # my changes follow

##################
...

+CONFIGURE_ENV+= CMAKE_INSTALL_PREFIX=${PREFIX}/cppcheck148
+CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX}/cppcheck148
+
.include "options.mk"

.PHONY: man-build
##################

To follow up, I see there is no way to configure
CMAKE_INSTALL_PREFIX. This comes from mk/configure/cmake.mk:

CMAKE_ARGS+=    -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX}

On the other hand mk/configure/gnu-configure.mk works this
way:

GNU_CONFIGURE_PREFIX?=  ${PREFIX}
CONFIGURE_ARGS+=        --prefix=${GNU_CONFIGURE_PREFIX:Q}

What about the following change:

--- mk/configure/cmake.mk.orig  2011-01-13 02:01:04.000000000 +0100
+++ mk/configure/cmake.mk       2011-10-28 22:51:04.000000000 +0200
@@ -18,7 +18,8 @@

 _CMAKE_DIR=    ${BUILDLINK_DIR}/cmake-Modules

-CMAKE_ARGS+=   -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX}
+CMAKE_INSTALL_PREFIX?= ${PREFIX}
+CMAKE_ARGS+=   -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
 CMAKE_ARGS+=   -DCMAKE_MODULE_PATH:PATH=${_CMAKE_DIR}
 .if ${OPSYS} != "Darwin"
 CMAKE_ARGS+=   -DCMAKE_SKIP_RPATH:BOOL=TRUE

This fixed my cmake-based packages. While CMAKE_INSTALL_PREFIX
seems to me to be a "natural" way to configure the install
destination there may be better ways to resolve the issue.
Any comment from the initiated?

Best regards
norc


Home | Main Index | Thread Index | Old Index