<div dir="ltr">When you use bare semicolon, it is required to encapsulate the whole generator expression in quotes to avoid list evaluation during command call;<div><br></div><div>i.e:</div><div>WRONG:<font face="monospace" size="2"> target_compile_options(</font><span style="color:rgb(33,33,33);font-family:monospace,monospace">someTarget PRIVATE</span><span style="color:rgb(33,33,33);font-family:monospace,monospace"> $<$<COMPILE_LANGUAGE:CXX>:-</span><span style="color:rgb(33,33,33);font-family:monospace,monospace">Wall;-Wextra></span><span style="color:rgb(33,33,33);font-family:monospace,monospace">)</span></div><div><span style="color:rgb(33,33,33)">GOOD: </span><font face="monospace" size="2">target_compile_options(</font><span style="color:rgb(33,33,33);font-family:monospace,monospace">someTarget PRIVATE</span><span style="color:rgb(33,33,33);font-family:monospace,monospace"> "$<$<COMPILE_LANGUAGE:CXX>:-</span><span style="color:rgb(33,33,33);font-family:monospace,monospace">Wall;-Wextra>"</span><span style="color:rgb(33,33,33);font-family:monospace,monospace">)</span></div><div><span style="color:rgb(33,33,33);font-family:monospace,monospace"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr">Le dim. 3 juin 2018 à 15:03, Neil Carlson <<a href="mailto:neil.n.carlson@gmail.com">neil.n.carlson@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry, the missing colon was a typo in my email, not actually missing. Strangely, the bare semicolon doesn't work for me (Linux/make). However $<SEMICOLON> does work! That prompted me to try escaping the semicolon (\;) and that worked too. Thanks all!</div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 3, 2018 at 12:18 AM Marc CHEVRIER <<a href="mailto:marc.chevrier@gmail.com" target="_blank">marc.chevrier@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Did you try with $<SEMICOLON> rather than the ; character?<br><br><div class="gmail_quote"><div dir="ltr">Le dim. 3 juin 2018 à 06:24, Craig Scott <<a href="mailto:craig.scott@crascit.com" target="_blank">craig.scott@crascit.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jun 3, 2018 at 12:34 PM, Neil Carlson <span dir="ltr"><<a href="mailto:neil.n.carlson@gmail.com" target="_blank">neil.n.carlson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sat, Jun 2, 2018 at 4:53 PM Stephen McDowell <<a href="mailto:sjm324@cornell.edu" target="_blank">sjm324@cornell.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="auto">It should be a CMake list, which is delineated by semicolons.<div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif;font-size:12.8px">add_compile_options($<$<</span><span style="font-family:sans-serif;font-size:12.8px">COMPILE_LANGUAGE:C>-Wall;-Wextra>)</span><br><div dir="auto"><br></div><div dir="auto">I am writing this from a phone so untested, but that has worked for me in the past.</div></div></div></blockquote><div><br></div><div>Right about the list, and is one of the things I tried, but didn't work. This one</div><div>seems to break the generator expression.</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I think you are missing a colon after the first ">". I just tried a command like the following and it produces the right compiler command line options for me (on macOS using CMake 3.11.0 with either Ninja or Xcode):</div><div><br></div><font face="monospace, monospace">target_compile_options(someTarget PRIVATE<br> $<$<COMPILE_LANGUAGE:CXX>:-Wall;-Wextra><br>)</font><div><br></div><div>I also works for me even without the semi-colon (i.e. using a space instead), which was kinda surprising given that I didn't quote the whole generator expression. Not sure about other platforms or generators.</div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><br clear="all"><div><br></div>-- <br><div class="m_-3221767192193370824m_134988756537893321m_8531031120587625124gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div></div></div></div></div></div></div>
</div></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>