<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">https://stackoverflow.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>