<div dir="ltr">Are you trying to construct a BUILD_COMMAND line that looks like CXXFLAGS=-g -02 -w && ./configure?<br><div><br></div><div>If so, you should be able to do that with the CMake -E env command option like this ( Starting in CMake 3.1 ):</div><div><br></div><div><div>set(cxx_flags "-g -O2 -w")</div><div>set(command_to_run ${CMAKE_COMMAND} -E environment)</div><div>ExternalProject_Add(MyProject</div><div> DOWNLOAD_COMMAND ""</div><div> CONFIGURE_COMMAND ""</div><div> BUILD_COMMAND ${CMAKE_COMMAND} -E env CXXFLAGS=${cxx_flags} ${command_to_run}</div><div> )</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 21, 2018 at 10:39 PM, Andrew Brownsword <span dir="ltr"><<a href="mailto:andrew.e.brownsword@gmail.com" target="_blank">andrew.e.brownsword@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I’m using the externalproject_add command to build a non-cmake project. To the build I am passing CXXFLAGS=value, but I cannot manage to get any spaces into the value no matter how I quote, use variables, use escapes, etc. Searching turns up other people with the same problem and no particularly good solutions. One example was to use cmake_command -E echo to create a wrapper script that contains the desired string, however this isn’t working for me either (its seems to behave as if the cmake_command variable is empty or undefined). This seems WAY harder than it should be...<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: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>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/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>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/<wbr>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/<wbr>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/<wbr>listinfo/cmake</a><br>
</blockquote></div><br></div>