[CMake] How to force value to cache variable without retyping doc string?
rcdailey at gmail.com
Tue Nov 1 14:37:06 EDT 2011
There is a one-time operation I need CMake to perform the very first time a
user generates. This operation involves copying several files from a remote
server (third party libraries) and placing them in the binary dir.
Right now I'm attempting to do this via a cache variable:
set( COPY_DONE false CACHE BOOL "This is my documentation" )
if( NOT COPY_DONE )
....... do work ........
set( COPY_DONE true )
I do not make this an INTERNAL cache variable because at any time the user
should be able to set COPY_DONE to false manually and it should recopy
everything, and then set it back to 'true'.
The code above does not work because I'm not using set( COPY_DONE true
............ FORCE ). But I have to resupply the docstring if I do it this
Am I going about this the wrong way? Can anyone recommend a different
approach? If not, how can I do this without having to duplicate the doc
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the CMake