What I would like to do is create some kind of batch generation for every combination of debug/release, static/dynamic.<br><br>So I would call:<br>echo building static release<br>cmake -D cfg=release -D link=static .<br>
make all &amp;&amp; make install<br>
<br>echo building dynamic release<br>
cmake -D cfg=release -D link=dynamic .<br>
make all &amp;&amp; make install<br>
<br><br>etc ...<br><br>However when I call the set() it overwrites the cached value.<br>It should only be called if I didn&#39;t get a parameter from the commandline.<br><br>So for example the first time I call &quot;cmake -D cfg=release -D link=static .&quot;.<br>
cfg and link is set.<br>But if I call &quot;cmake -D cfg=debug .&quot; afterwards,<br>cfg is set to debug, and link is set to static (as being the previous cached entry).<br><br>Do you think it would be ok for the end-user?<br>
<br><br>If so, than I could simply do a &quot;if(not cfg) set(cfg &lt;default&gt; cache)&quot; as to set the default cfg entry.<br><br><br>grtz,<br>Steven<br><br><br><br><br><div class="gmail_quote">2008/11/26 David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">There is not a good/easy way to do this that I can think of off the top of my head...<div><br>
</div><div>Why do you need to tell where a variable came from...?<br>What are you going to do differently based on this information?</div>
<div><br></div><div><br><div class="gmail_quote"><div><div></div><div class="Wj3C7c">On Wed, Nov 26, 2008 at 10:03 AM, Steven Van Ingelgem <span dir="ltr">&lt;<a href="mailto:steven@vaningelgem.be" target="_blank">steven@vaningelgem.be</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Hi,<br><br><br>How can I determine which parameters have been entered via command line, which come from the script and which from the cache?<br><br>For example:<br>--------<br>MESSAGE(STATUS &quot;TEST (before): ${TEST}&quot;)<br>


SET(TEST &quot;a&quot;)<br>MESSAGE(STATUS &quot;TEST (after):  ${TEST}&quot;)<br>
--------<br>
<br>C:\tmp&gt;cmake . -G&quot;MinGW Makefiles&quot;<br>-- TEST (before):<br>-- TEST (after): a<br>C:\tmp&gt;cmake .<br>-- TEST (before):<br>-- TEST (after): a<br>C:\tmp&gt;cmake -D TEST=b .<br>-- TEST (before): b<br>-- TEST (after): a<br>


C:\tmp&gt;cmake .<br>-- TEST (before): b<br>-- TEST (after): a<br><br>What I want to detect is how the parameter is set. Via the cache (4th step), via the command line (3rd step) or via the script (step 1/2)?<br><br>Can anyone help me with that?<br>


<br><br>Thanks,<br><font color="#888888">Steven<br><br><br>
</font><br></div></div>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>
</blockquote></div><br>