[CMake] Text user configuration (features, flags) that is more persistent than cache?

Ateljevich, Eli eli at water.ca.gov
Thu Jun 21 16:25:16 EDT 2012


Hi,
I was wondering if there is a best practice for providing a file for user configuration decisions (options, unique flags) that will be more persistent than the cache? I have a project where a dozen or two algorithmic decisions have to be made. I find that this is just enough that cache overwrites cause me fear. I could do this on the environment, I suppose, but most of my users prefer a small list of name-value pairs for decisions that are pretty stable for them.

I couldn't find anything on this. The concept is alluded to by a 2001 email about INCLUDE by Bill Hoffman:
It could be used like this:

INCLUDE (${PROJECT_BINARY_DIR}/UserCacheSettings.txt OPTIONAL)

This would allow the user to pre-set values for the Cache file, but still
be able to delete the Cache file.

But I wasn't sure about the mechanics of this. When would it have to be read to fulfill this role and what does "pre-set" really mean in light of that as far as precedence if there are duplicate entries? Wouldn't everything that could be set have to be something that will also appear in CMakeCache.txt? I assume the format would be just like CMakeCache.txt? ...which would be ideal.

Thanks,

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120621/28c531d8/attachment.htm>


More information about the CMake mailing list