[CMake] cmake policy setting

Eric Noulard eric.noulard at gmail.com
Fri Oct 29 09:37:52 EDT 2010


2010/10/29 Marco Atzeri <marco_atzeri at yahoo.it>:
> As there is no example in the documentaion,
> could someone clarify me if the change of any policy
> that should require an additional
>
> cmake_policy(SET CMP<NNNN> NEW)
>
>
> could also be requested at cmake invocation with
> ---------------------------------------------------
> # -D <var>:<type>=<value>: Create a cmake cache entry.
>
> When cmake is first run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable settings for the project. This option may be used to specify a setting that takes priority over the project's default value. The option may be repeated for as many cache entries as desired.
> ---------------------------------------------------

I do not think policy value reaches the CMake cache.

and I don't know a way to set up policy from command line.

I'll have to check the code but even if policy has the "SET" argument in it
it does not share properties with the CMake "set" command itself.

"set" and "cmake_policy" are 2 separate CMake commands.

the -D <var>:<type>=<value> command line argument may "replace"
"set" command in CMakeLists.txt but I am not aware of any command
line args that may be used to enforce policy.

Again I'll have to check the source code to be sure.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list