[CMake] Passing parameters via command prompt

David Cole david.cole at kitware.com
Wed Nov 26 10:33:13 EST 2008


There is not a good/easy way to do this that I can think of off the top of
my head...
Why do you need to tell where a variable came from...?
What are you going to do differently based on this information?


On Wed, Nov 26, 2008 at 10:03 AM, Steven Van Ingelgem <steven at vaningelgem.be
> wrote:

> 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
>
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081126/842d7937/attachment.htm>


More information about the CMake mailing list