[Cmake] CMake SET + CMakeCache.txt
Neil Killeen
Neil.Killeen at atnf.csiro.au
Sun Apr 6 23:55:58 EDT 2003
Brad
On Fri, 4 Apr 2003, Brad King wrote:
> > I have the line:
> >
> > # Compiler flags
> > SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
> >
> > at the end of my CMakeLists.txt file.
> >
> > I was expecting, after running cmake, that when I looked in
> > CMakeCache.txt that the line
> >
> > //Flags used by the compiler during all build types.
> > CMAKE_CXX_FLAGS:STRING=
> >
> > would actually have "-Wno-deprecated" on it. But it doesn't.
>
> The SET command sets cmake variables.
> The cache entries are used to INITIALIZE the variables.
> A SET command with the CACHE option is used to
> INITIALIZE a cache entry that doesn't exist. Once a value is set in the
> cache, it can be changed only by the user from the GUI.
>
ok, but i still don't know how to do what I want !
I am looking for a mechanism for use in a CMakeLists.txt file by which I
can APPEND to- rather than INITIALIZE- the contents of a cmake variable ,
in this case CMAKE_CXX_FLAGS so that when so that when I run ccmake, what I appended
and what was already there will appear.
Is that possible ? I would have expected this is a common thing to want
to do, since how else can the ccmake user know what has been set if it
does not appear in the GUI ?
cheers
Neil
More information about the CMake
mailing list