BTW thank you for the choice() function. I have looked it over and it looks perfect. I&#39;m going to actively use this in our project. It would be a perfect addition to the language as well.<div><br></div><div>As far as knowing when to use quotations is concerned, according to the logic you have described, is that consistent behavior? In other words, across all CMake commands, regardless of what the contents of a string is (whitespace and whatnot), it is safe to pass it in without quotes unless it may possibly be empty, in which case I&#39;d use &quot;${var}&quot;.</div>
<div><br></div><div>I agree that knowing when to use quotes can be confusing, but once you understand a couple of rules it is pretty easy. Maybe you can give an example of a more ambiguous case :)</div><div><br></div><div>
Thanks again David.<br><div><div><br></div><div>---------</div>Robert Dailey<br>
<br><br><div class="gmail_quote">On Fri, Dec 9, 2011 at 9:27 AM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="HOEnZb"><div class="h5">On Fri, Dec 9, 2011 at 9:59 AM, Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On Thu, Dec 8, 2011 at 7:59 PM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Well, nearly....<br>
&gt;&gt;<br>
&gt;&gt; You&#39;ll have to double-quote the &quot;${documentation}&quot; inside the function<br>
&gt;&gt; in case it is the empty string...<br>
&gt;<br>
&gt;<br>
&gt; Or if it has spaces in it, right? Any time I have a string with spaces in<br>
&gt; it, or that could have spaces in it, I use quotes so the value of the string<br>
&gt; doesn&#39;t get interpreted as multiple parameters (like a list)<br>
&gt;<br>
<br>
</div></div>No, in this case, it&#39;s just in case it&#39;s empty because the CACHE form<br>
of set expects to get the type and the docstring following the CACHE<br>
keyword. If ${documentation} evaluates to the empty string, then the<br>
set command only &quot;sees&quot; 4 arguments and yields an error.<br>
<br>
The example CMakeLists file did have spaces in the documentation<br>
strings, but they worked just fine.<br>
<br>
In the case of set, the 5th argument can be ${documentation} or<br>
&quot;${documentation}&quot; as long as it&#39;s non-empty, and the results are<br>
equivalent. But if it&#39;s empty, the double-quoted form must be used.<br>
<br>
CMake&#39;s parser is the thing that splits at space boundaries when<br>
evaluating what to send into the set command. But since the actual<br>
literal code ${documentation} does not have spaces in it, it&#39;s full<br>
value (including any spaces in the value) get sent into the set<br>
command internally as arg 5.<br>
<br>
Understanding when you have to quote things is simply one of the<br>
hardest things to grok when dealing with CMake language code. Stick<br>
with it, though. It&#39;s easier than learning git. It only took me about<br>
2 years of practice before I think something snapped into place in my<br>
brain...<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
David<br>
</font></span></blockquote></div><br></div></div>