<div><div dir="auto">In fact, the right way to manage « composite » options is to use « SHELL: » prefix (introduced in up-coming version 3.12).</div></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div>Le dim. 3 juin 2018 à 16:11, 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><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>On Sun, Jun 3, 2018 at 7:33 AM Neil Carlson <<a href="mailto:neil.n.carlson@gmail.com" target="_blank">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><br><div class="gmail_quote"><div>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>[...]<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>
-- <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></div>