2011/7/6 Alexander Neundorf <span dir="ltr">&lt;<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wednesday 06 July 2011, Jerry Gagelman wrote:<br><br>
</div>If these variables exist already in the cache, then a simple<br>
set(... CACHE ...)<br>
does not override the value which is already in the cache.<br>
You can only override a value in the cache from a CMakeLists.txt by using<br>
set(... CACHE... FORCE)<br>
This will put the given value always in the cache. Which also means if the<br>
user changes the value using &quot;make edit_cache&quot;, the set(...CACHE ... FORCE)<br>
will override his changes again.<br>
<br>
Is this the behaviour you are seeing ?<br>
<br></blockquote><div><br></div><div>Thanks. That is the behavior I&#39;m seeing. But it&#39;s still not satisfactory. Is it not possible to &quot;initialize&quot; variables in the cache with values using the set() command? </div>
<div><br></div><div>I just tried the following, ignoring the cache altogether:</div><div><br></div><div><div>set( CMAKE_C_FLAGS_DEBUG &quot;-Wall -Wno-format -g -DDEBUG&quot; )</div><div>set( CMAKE_C_FLAGS_RELEASE &quot;-Wall -Wno-unknown-pragmas -Wno-format -O3&quot; )</div>
</div><div><br></div><div>I rebuilt everything, ensured that the CMAKE_BUILD_TYPE variable in the cache is set to &quot;Debug,&quot; and built the library using verbose Makefiles. The compilation commands don&#39;t include the extra CMAKE_C_FLAGS_DEBUG flags as directed.</div>
<div><br></div><div>I even tried it without quotes around the flag strings.</div><div><br></div><div>Evidently the cache is overriding commands in CMakeLists.txt. </div><div><br></div><div>Does anyone know if this is supposed to be a feature? If so, it feels rather strange. I&#39;m happy to file a bug report. </div>
<div><br></div><div>Thanks,</div><div>Jerry</div><div><br></div><div><br></div></div>