[Cmake] Resetting a variable

John Biddiscombe john.biddiscombe at mirada-solutions.com
Thu May 1 09:09:55 EDT 2003


> You can change a cache value with a SET(var value FORCE).   However,
> this is a dangerous feature.   The problem is that cache variables
> can be set by the user.    If a cmakelist file changes the value set
> by a user, it can no longer be set by the user.

This has annoyed me many times...how does one change a default value to a different default (without editing the Cmake Modules). If you FORCE it, then it keeps getting reset every time the user changes it. If you don't, then you haven't changed the default, 

you need to set a flag for the first time you run and change the default using FORCE, then clear the flag (anmd CACHE it) and afterwards stop FORCEing. it's grotesque...

how about some kind of SET (variable FORCEONCE) ! is there an easy way of doing it (especially if you need to change lots of variables)

JB




More information about the CMake mailing list