[CMake] Names of known variables

William A. Hoffman billlist at nycap.rr.com
Thu Jun 15 15:06:55 EDT 2006


At 02:47 PM 6/15/2006, Alexander Neundorf wrote:
>Hi,
>
>Von: "Brandon J. Van Every" <bvanevery at gmail.com>
>
>> Philippe Poilbarbe wrote:
>> > Hello,
>> >
>> > How can I get the names and usage of cmake variables.
>> > For functions we have the various --help options but nothing for 
>> > variables.
>> > When I bought the "Mastering CMake" book there was some of them (and
>> > it was not up to date) but it's quite difficult to find the new ones
>> > as new versions of cmake are coming.
>> >
>> > There is many answers on this list of the form: 'to do this set the
>> > value of this variable to this and it will do the trick'.
>> 
>> Although it's not complete, 
>> http://www.cmake.org/Wiki/CMake_Useful_Variables has a number of them.  
>> I agree that documentation of variables is a weak point of CMake.
>
>So please take the time to help with the wiki page :-)

If you want to see all the variables, with no documentation on
a particular run of cmake, you can do this:

FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
             "${var} \"${${var}}\"\n")
ENDFOREACH(var ${res})


-Bill



More information about the CMake mailing list