[Cmake] CMake SET + CMakeCache.txt

Neil Killeen Neil.Killeen at atnf.csiro.au
Fri Apr 4 01:43:49 EST 2003


Hello

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.

Now

1) the extra compiler switch IS correctly written into the Makefiles

2) I tried various SET incantations such as

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated" CACHE INTERNAL "i like chocolate")

to try to get it to appear but failed.   I didnt really expect this to
work - as soon as you use the CACHE argument you MUST set TYPE and
DOCSTRING.  But of course somebody else has set DOCSTRING for
this variable (I don't know where) so this suggests to me this is the
wrong approach anyway.

I can only get things to appear in the cache file if I create the
variable entirely myself, rather than it being one that CMake
is making for me.

Can someone explain to me this mechanism please ?  I have looked in the
FAQ and documentation but can't find anything relevant.


------------------------------------------------------------------------

A second thing.  The documentation for the SET function
does not inform you what the possible types for argument "TYPE"
are.  It says you can use INTERNAL but there is no other advice.
Since SET is a rather important command, it would be helpful
to describe its arguments more carefully.




thanks
Neil










More information about the CMake mailing list