<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 dir="auto"><br></div><div dir="auto">-Stephen</div><div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 2, 2018, 3:47 PM 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">I'm attempting to use a generator expression to conditionally add compile options. No problem if it is a single option, but I can't figure out how to manage multiple options (in a single command). <div><br></div><div>For example, this works:<div><div>add_compile_options($<$<COMPILE_LANGUAGE:C>-Wall>)</div></div></div><div><br></div><div>As does this:</div><div>add_compile_options(-Wall -Wextra)</div><div><br></div><div>But not this:</div><div><div>add_compile_options($<$<COMPILE_LANGUAGE:C>-Wall -Wextra>)</div></div><div><br></div><div>Nor this:</div><div><div>add_compile_options($<$<COMPILE_LANGUAGE:C>"-Wall -Wextra">)</div></div><div><br></div><div>Or any other variation I could think of.  Either the space breaks the generator expression, or I get a quoted version of the options that the compiler sees as a single "option" it doesn't understand.</div><div><br></div><div>Is there some way of doing this?</div><div><br></div><div>PS: I'm trying to avoid using CMAKE_C_FLAGS. My understanding is that variable is meant for the end user's use.  Am I mistaken about that?</div><div><br></div></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer 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 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 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 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 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 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 noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>