[CMake] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

John Drescher drescherjm at gmail.com
Mon Dec 21 15:59:46 EST 2009


On Mon, Dec 21, 2009 at 3:50 PM, Claus Klein <claus.klein at arcormail.de> wrote:
> Hi all,
>
> I tried to use:
>   set(CMAKE_USE_RELATIVE_PATHS ON)
> in my CMakeLists.txt.
>
> But I noticed, that some cmake variables can't be changed in that way.
> In the CMakeCache.txt, it is still OFF?
>
I have no idea about CMAKE_USE_RELATIVE_PATHS since I have never
needed/wanted to use that however for the other cases that it appears
the CMake does not let me change a value I usually get around this
using the following examples:

SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
CACHE STRING "Default Install Path" FORCE)


IF (MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo" CACHE STRING
"Debug;RelWithDebInfo" FORCE)
SET (RELEASE_BUILD_NAME "RelWithDebInfo")
ELSE(MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"Debug;Release" FORCE)
SET (RELEASE_BUILD_NAME "Release")
ENDIF (MAKE_DEBUGRELEASE)


The keys are CACHE and FORCE.


John


More information about the CMake mailing list