<div dir="ltr"><div><br></div><div>(platfrom defines is a variable suitable for like ADD_DEFINITIONS( ${PLATFORM_DEFINES} ) </div><div><br></div><div><br></div><div>  string( REPLACE ";" " " PLATFORM_DEFINES_ARG "${PLATFORM_DEFINES}" )</div><div><div>  ExternalProject_Add( target</div></div><div>    ....</div><div><div><span style="white-space:pre">        </span>CMAKE_ARGS -DPLATFORM_DEFINES=${PLATFORM_DEFINES_ARG}</div></div><div>    ......</div><div> )</div><div><br></div><div><br></div><div>and in the target cmakelists to use the argument</div><div><br></div><div><br></div><div><div>STRING( REPLACE " " ";" PLATFORM_DEFINES ${PLATFORM_DEFINES} )</div><div><br></div><div>add_definitions( ${PLATFORM_DEFINES} )</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 31, 2018 at 9:36 AM, Saad Khattak <span dir="ltr"><<a href="mailto:saadrustam@gmail.com" target="_blank">saadrustam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have the following setup:<div>Superbuild</div><div>   - ExternalProject_Add(a...)<br>   - ExternalProject_Add(b...)</div><div>   - ExternalProject_Add(c...) </div><div>   - ExternalProject_Add(d...)<br><br>The SuperBuild is built from command line with some options e.g. -DMY_OPTION=TRUE. I would like all these options to be passed to each of the ExternalProject_Add CMAKE_ARGS.</div><div><br></div><div>I tried to capture the arguments using the solution posted here: <a href="https://stackoverflow.com/a/10218582/368599" target="_blank">https://stackoverflow.<wbr>com/a/10218582/368599</a></div><div><br></div><div>The arguments are captured properly (i.e. I printed them out to make sure they are correct) but relaying them to ExternalProject_Add appears to be problematic. I tried the following ways to forward the arguments (as outlined in the stackoverflow solution):<br><br>ExternalProject_Add(...<br>  CMAKE_ARGS ${CMAKE_ARGS}<br>  )<br><br>ExternalProject_Add(...<br>  CMAKE_ARGS "${CMAKE_ARGS}" # quotes<br>  )</div><div><br></div><div>ExternalProject_Add(...<br>  CMAKE_ARGS "${MY_CMAKE_ARGS}" # changed the variable name in case it conflicts<br>  )  <br><br>None of that seems to work. CMake appears to ignore the commands forwarded.</div><div><br></div><div>Is there something I am missing?</div><div><br></div><div>Thanks,</div><div>Saad<br><br></div></div>
<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>
<br></blockquote></div><br></div>