<div dir="ltr"><br><div class="gmail_extra"><br><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">COMPIL<wbr>E_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>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><br clear="all"><div><br></div>-- <br><div class="gmail_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>