[CMake] cmake and caching multiline strings problem

Prakash Punnoor lists at punnoor.de
Sun Nov 20 11:06:16 EST 2005


Brad King schrieb:
> Prakash Punnoor wrote:
> 
>>is this a bug or illegal to do? I try to store a multiline string in
>>CMakeCache.txt, but this breaks:
>>
>>SET(A "1
>>2
>>3
>>" CACHE INTERNAL "")
>>
>>On second run this gives me a parse error (snipped):
>>
>>CMake Error: Parse error in cache file CMakeCache.txt. Offending entry: 2
>>CMake Error: Parse error in cache file CMakeCache.txt. Offending entry: 3
> 
> 
> Multiline strings were added to CMake in version 2.0 but no one ever 
> implemented support in the cache for them.  What are you trying to do 
> with them?

I worked around the issue, but I wanted cmake to generate a config.h. I
didn't want to use ADD_DEFINITIONS and I didn't want to use a prebuild
configure.h.in file in conjunction wirh CONFIGURE_FILE. Thus I wanted to
save the generated config.h file in cache and only rewrite it if it
changed - otherwise a rebuild is forced. As a workaround I use a second
var and add the configh.h file w/o enters. This seems to work. :-)

BTW, I have another issue, but I better start a new thread.

Cheers,

Prakash
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://public.kitware.com/pipermail/cmake/attachments/20051120/835bab78/signature.pgp


More information about the CMake mailing list