<div dir="ltr"><div>Something not immediately obvious to me, and perhaps not to others that might come across this thread, is that all spaces in the option string need to be replaced with a semicolon, and not just those that separate options (with Linux/make at least). For example  an option that takes an argument '-assume realloc_lhs'. If you do this:</div><div><br></div><div>BAD: add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-assume realloc_lhs>")</div><div><br></div><div>you get a single quoted token "-assume realloc_lhs" on the compile line which the compiler doesn't understand. The correct thing is</div><div><br></div><div>GOOD: add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-assume;realloc_lhs>")</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 3, 2018 at 7:33 AM Neil Carlson <<a href="mailto:neil.n.carlson@gmail.com">neil.n.carlson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 3, 2018 at 7:08 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"><div dir="ltr">[...]<br><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></blockquote><div><br></div><div>Ah, that's it. Never occurred to me to quote the whole thing, thinking that would turn the generator expression into a literal string and not be interpreted.  Thanks! </div><div><br></div><div> </div></div></div>
</blockquote></div>