[CMake] Which variables are available in initial cache file

blessjah+cmake at jacekowski.org blessjah+cmake at jacekowski.org
Mon Jun 16 08:48:08 EDT 2014


Hi,


I need to read content of some file from source tree during initial cache phase.
I'm trying to find out which variables are available at that early stage of project
configuration, or otherwise how to put path in this file.

I'm trying with following variables:
        CMAKE_BINARY_DIR
        CMAKE_CURRENT_BINARY_DIR
        CMAKE_CURRENT_LIST_DIR
        CMAKE_CURRENT_LIST_FILE
        CMAKE_CURRENT_SOURCE_DIR
        CMAKE_HOME_DIRECTORY
        CMAKE_SOURCE_DIR

But most of those, with the exception of *_LIST_* seems to be either empty or pointing
to build dir.

Also, it seems that some of those (especially CMAKE_HOME_DIRECTORY) are either set or
unset (randomly) when I try to configure project multiple times.


Best regards
BlessJah



More information about the CMake mailing list