It&#39;s not a bug in add_definitions.<br><br>Quotes matter. With a space in the string inside the quotes, you are telling add_definitions that there is a single definition with a space in it. Without the quotes, you are telling add_definitions that there are two definitions separated by the space.<br>
<br>The basic syntax for CMake commands is arguments are space separated. If you quote a string, then it counts as a single argument to the command including spaces that are inside of it.<br><br>These are *not* equivalent:<br>
 add_defintions(&quot;-DMYDEF -DMYOTHERDEF&quot;) # space embedded in a single string arg<br> add_defintions(-DMYDEF -DMYOTHERDEF) # space separates args<br>

<br>But these *are* equivalent:<br>
 add_defintions(&quot;-DMYDEF&quot; &quot;-DMYOTHERDEF&quot;) # space separates args (not inside &quot;&quot;)<br>
 add_defintions(-DMYDEF -DMYOTHERDEF) # space separates args<br>


<br><br>Hopefully, this helps somewhat.<br><br>David<br><br><br><div class="gmail_quote">On Thu, May 28, 2009 at 3:55 AM, Marcel Loose <span dir="ltr">&lt;<a href="mailto:loose@astron.nl">loose@astron.nl</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br>
<br>
I ran into this while trying to compile a few assembly sources (see<br>
thread: Problem with ASM and COMPILE_DEFINITIONS).<br>
<br>
Definitions added using add_definitions() with a quoted string<br>
containing more than one argument are NOT discarded by CMake<br>
when /usr/bin/as is called. For example, when using:<br>
<br>
  add_defintions(&quot;-DMYDEF -DMYOTHERDEF&quot;)<br>
<br>
these definitions remain as arguments to /usr/bin/as.<br>
<br>
However, when supplying only a single argument, quotes don&#39;t seem to<br>
matter. Also, when removing the quotes on the multiple arguments above,<br>
CMake properly discards these preprocessor variables when<br>
invoking /usr/bin/as.<br>
<br>
Is this a bug in add_definitions?<br>
<br>
Best regards,<br>
Marcel Loose.<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>