[CMake] How to get modified cache variables?

Stefan Reuschl lists at stefanreuschl.de
Sun Sep 2 16:15:51 EDT 2012


Hi,

is there a direct way to find out which cache variables are modified?
Cache variables might be modified directly by the user (i.e. using cmake  
-D oder cmake-gui).
And they could also be outdated because the default value in the "set(...  
CACHE ...)"
command was changed in the CMakeLists.txt when updating the source from  
repository.

I'm thinking of two use cases which would be much simpler if that feature  
would be available:
- Get outdated/modified cache variables and reset them using "cmake -U"  
without having to
   delete the whole build directory.
- Get a list of user modified cache variables to keep track of the  
configuration e.g.
   to reproduce a build.

I tried playing around which the MODIFIED property for cache variables but  
that's never set
or returns a flag.

Regards,
   Stefan


More information about the CMake mailing list