[CMake] Passing parameters via command prompt

Steven Van Ingelgem steven at vaningelgem.be
Wed Nov 26 10:03:27 EST 2008


Hi,


How can I determine which parameters have been entered via command line,
which come from the script and which from the cache?

For example:
--------
MESSAGE(STATUS "TEST (before): ${TEST}")
SET(TEST "a")
MESSAGE(STATUS "TEST (after): ${TEST}")
--------

C:\tmp>cmake . -G"MinGW Makefiles"
-- TEST (before):
-- TEST (after): a
C:\tmp>cmake .
-- TEST (before):
-- TEST (after): a
C:\tmp>cmake -D TEST=b .
-- TEST (before): b
-- TEST (after): a
C:\tmp>cmake .
-- TEST (before): b
-- TEST (after): a

What I want to detect is how the parameter is set. Via the cache (4th step),
via the command line (3rd step) or via the script (step 1/2)?

Can anyone help me with that?


Thanks,
Steven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081126/4bc69677/attachment.htm>


More information about the CMake mailing list