<div dir="ltr"><div><span style="color:rgb(33,33,33)"><br></span></div><span style="color:rgb(33,33,33)">Using "SHELL:": <font face="monospace">add_compile_options("$<$<COMP</font></span><font face="monospace"><span style="color:rgb(33,33,33)">ILE_LANGUAGE:Fortran>:SHELL:-assume </span><span style="color:rgb(33,33,33)">realloc_lhs>")</span> </font><br><div>By using "SHELL:", you ensure that the two parts of the option will be remain together.</div><div><br></div><div>Documentation is here: <a href="https://cmake.org/cmake/help/git-master/command/target_compile_options.html">https://cmake.org/cmake/help/git-master/command/target_compile_options.html</a></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">Le dim. 3 juin 2018 à 18:40, Hendrik Sattler <<a href="mailto:post@hendrik-sattler.de">post@hendrik-sattler.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Am 3. Juni 2018 16:33:12 MESZ schrieb Marc CHEVRIER <<a href="mailto:marc.chevrier@gmail.com" target="_blank">marc.chevrier@gmail.com</a>>:<br>
>In fact, the right way to manage « composite » options is to use «<br>
>SHELL: »<br>
>prefix (introduced in up-coming version 3.12).<br>
<br>
Can you modify the example to show its use?<br>
Why is it called shell? IMHO a build to its not required to use any kind of shell.<br>
<br>
>Le dim. 3 juin 2018 à 16:11, Neil Carlson <<a href="mailto:neil.n.carlson@gmail.com" target="_blank">neil.n.carlson@gmail.com</a>> a<br>
>écrit :<br>
><br>
>> Something not immediately obvious to me, and perhaps not to others<br>
>that<br>
>> might come across this thread, is that all spaces in the option<br>
>string need<br>
>> to be replaced with a semicolon, and not just those that separate<br>
>options<br>
>> (with Linux/make at least). For example an option that takes an<br>
>argument<br>
>> '-assume realloc_lhs'. If you do this:<br>
>><br>
>> BAD: add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-assume<br>
>> realloc_lhs>")<br>
>><br>
>> you get a single quoted token "-assume realloc_lhs" on the compile<br>
>line<br>
>> which the compiler doesn't understand. The correct thing is<br>
>><br>
>><br>
>> GOOD:<br>
>add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-assume;realloc_lhs>")<br>
>><br>
>><br>
>> On Sun, Jun 3, 2018 at 7:33 AM Neil Carlson<br>
><<a href="mailto:neil.n.carlson@gmail.com" target="_blank">neil.n.carlson@gmail.com</a>><br>
>> wrote:<br>
>><br>
>>><br>
>>> On Sun, Jun 3, 2018 at 7:08 AM Marc CHEVRIER<br>
><<a href="mailto:marc.chevrier@gmail.com" target="_blank">marc.chevrier@gmail.com</a>><br>
>>> wrote:<br>
>>><br>
>>>> [...]<br>
>>>> GOOD: target_compile_options(someTarget PRIVATE<br>
>>>> "$<$<COMPILE_LANGUAGE:CXX>:-Wall;-Wextra>")<br>
>>>><br>
>>><br>
>>> Ah, that's it. Never occurred to me to quote the whole thing,<br>
>thinking<br>
>>> that would turn the generator expression into a literal string and<br>
>not be<br>
>>> interpreted. Thanks!<br>
>>><br>
>>><br>
>>><br>
>> --<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:<br>
>> <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<br>
>more<br>
>> 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<br>
>> <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>
>><br>
</blockquote></div>