[CMake] initializing default values

William A. Hoffman billlist at nycap.rr.com
Fri Sep 2 08:24:31 EDT 2005


One way to do this is to create new cache variables.

# create a new variable and initialize it how you like and put it in
# the cache with no FORCE
SET(MYPROJ_CXX_FLAGS "...." CACHE STRING "common C++ build flags")
# Force the cmake variable to always have the value of your new variable
# Also change the type to INTERNAL so users can not edit it in ccmake or
# CMakeSetup.
SET(CMAKE_CXX_FLAGS "${MYPROJ_CXX_FLAGS}" CACHE INTERNAL "Internal flags do not edit" FORCE)


-Bill



At 06:15 AM 9/2/2005, Jan Woetzel wrote:
>Hi,
>i am actually overriding the values the same way you do.
>
>However, if the user edits teh value interactively (in ccmake/CMakeSetup) his changes will be ovverriden and lost due to the "CACHE ... FORCE".
>(1) Does anybody have an idea how to change just the intial "first camke run" CACHE  value of CMAKE_CXX_FLAGS
>and then let the user override them completely?
>
>Thanks,
>Jan.
>
>>SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "common C++ build flags" FORCE)
>> 
>-- 
>
> Dipl.-Ing. Jan Woetzel
>--------------------------------------------------
> University of Kiel
> Institute of Computer Science and Applied Mathematics
> Hermann-Rodewald-Str. 3 [room 310]
> 24098 Kiel/Germany
>--------------------------------------------------
> Phone +49-431-880-4477
> Fax   +49-431-880-4054
> Mob.  +49-179-2937346
>--------------------------------------------------
> Url   www.mip.informatik.uni-kiel.de/~jw
> Email jw at mip.informatik.uni-kiel.de
>
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list