[Cmake] CMake SET + CMakeCache.txt

Brad King brad.king at kitware.com
Tue Apr 8 10:04:07 EDT 2003


> If I do
>
> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
>
> then the ccmake user does not see the new string -Wno-deprecated.  OK,
> but what if they then decide to put some text on the line themselves
> with the ccmake GUI interface.
>
> Is this new text that they type in appended to what I had set above or
> does it replace it ?

The setting in the GUI only changes the value in the cache.  When the next
cmake configure step is done, the value is loaded to initalize the
corresponding cmake variable.  Then the SET command is invoked and appends
the flags again.

Each time you hit "c" in the ccmake GUI, a whole new pass through the
cmake listfiles is executed.  All variable values are re-initialized to
the values from the cache before the pass begins.

-Brad




More information about the CMake mailing list