[CMake] Easier way to override variables

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Wed Jul 18 11:58:19 EDT 2012


Hi Romain,

Have a look at the help for the function set:
$ cmake --help-command set

If I understand the documentation, this should be what you are looking for:
set(MY_VAR NEW_VALUE FORCE)

Cheers,
Yngve

On Wednesday 18. July 2012 15.49.31, Romain LEGUAY wrote:
> Hello everyone,
> 
> I don't find in any example to override a variable.
> 
> I proceed this way:
> 
> unset(MY_VAR CACHE)
> set(MY_VAR MY_NEW_VALUE)
> 
> I have many variables so I would like to have just one line to change
> just the value of the variable (not its documentation) in one line like
> this:
> 
> set(MY_VAR MY_NEW_VALUE FORCED)
> 
> Is it possible?
> 
> Thank you,
> 
> Romain
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list