<div dir="ltr"><div><div><div><div>Hi Jameson, <br><br></div>That is indeed the idea. <br><br><br></div>To clarify even further, <br><br>1) the call to <br><br>   ExternalProject_Include_Dependencies [1] <br><br></div>should be added before "ExternalProject_Add".  It  will recursively include the needed dependencies.<br>

<br><br>2) By simply adding an additional parameter:<br><br>    by default ${<project_name>_EP_ARGS}   <br><br>to ExternalProject_Add, the required argument will be automatically set. These includes CMAKE_CACHE_ARGS, CMAKE_ARGS, CMAKE_GENERATOR, LIST_SEPARATOR. See [2] for an example. Note that doesn't prevent you to explicitly pass additional CMAKE(_CACHE)_ARGS.<br>

</div><div><div><div><br><br></div><div>3) The name of the variable  to pass to ExternalProject_Add can explicitly be specified by passing the EP_ARGS_VAR variable. See [3] for full signature.<br><br><br></div><div>4) Using this module implies that each external project will be specified in a separate file. This is currently needed because the "return()" command is called in case the external project has already been included by an other project.<br>

<br><br></div><div>5) To debug, it is possible to uncomment line referenced in [4]<br><br><br></div><div>6) The yet to be integrated module "ExternalProjectForNonCMakeProject" could also be useful. See [5]<br></div>

<div><br><br></div><div>7) Finally, the best way to contribute, propose API change to support more use case or ask question is pull requests :) The list issue is available here: <a href="https://github.com/commontk/Artichoke/issues">https://github.com/commontk/Artichoke/issues</a><br>

<br></div><div>Hth<br></div><div>Jc<br></div><div><br>[1] <a href="https://github.com/Slicer/Slicer/blob/45bba0632e37239be3ae3d2ca4b5cf0833dbe4fc/SuperBuild/External_VTKv6.cmake#L11">https://github.com/Slicer/Slicer/blob/45bba0632e37239be3ae3d2ca4b5cf0833dbe4fc/SuperBuild/External_VTKv6.cmake#L11</a><br>

<div><div><div><div><div><div><div class="gmail_extra"><br>[2] <a href="https://github.com/Slicer/Slicer/blob/45bba0632e37239be3ae3d2ca4b5cf0833dbe4fc/SuperBuild/External_VTKv6.cmake#L100">https://github.com/Slicer/Slicer/blob/45bba0632e37239be3ae3d2ca4b5cf0833dbe4fc/SuperBuild/External_VTKv6.cmake#L100</a><br>

<br>[3] <a href="http://cmake-artichoke.readthedocs.org/en/latest/ExternalProjectDependency.html#function:ExternalProject_Include_Dependencies">http://cmake-artichoke.readthedocs.org/en/latest/ExternalProjectDependency.html#function:ExternalProject_Include_Dependencies</a><br>

<br>[4] <a href="https://github.com/commontk/Artichoke/blob/b0cf6fc85d5a490dc5a10a8f4a319678151722d2/ExternalProjectDependency.cmake#L671-675">https://github.com/commontk/Artichoke/blob/b0cf6fc85d5a490dc5a10a8f4a319678151722d2/ExternalProjectDependency.cmake#L671-675</a><br>

<br>[5] <a href="https://github.com/commontk/Artichoke/issues/7">https://github.com/commontk/Artichoke/issues/7</a><br><br><br><div class="gmail_quote">On Tue, Jun 3, 2014 at 1:49 AM, jmerkow <span dir="ltr"><<a href="mailto:jmerkow@gmail.com" target="_blank">jmerkow@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Jc,<br>
<br>
Thanks a lot this may be exactly what I am looking for.<br>
<br>
Basically I include ExternalProjectDependency in my project, then<br>
mark_as_superbuild() options/vars that I want to pass back to the 'normal'<br>
build.  Add the external project with 'CMAKE_CACHE_ARGS' and this will pass<br>
those variables to the build (assuming that it has the same name).  Then as<br>
long as a lib is contained in '${${PROJECT_NAME}_DEPENDS}' it will be loaded<br>
from the Externals dir (set(EXTERNAL_PROJECT_DIR<br>
${CMAKE_CURRENT_SOURCE_DIR}/TheExternals)), similar to the FindPackage(lib)<br>
mechanic.<br>
Does this sum it up?<br>
<br>
I've added a few mark_as_superbuild to my project is there an easy way to<br>
list out what variables will me passed?<br></blockquote><div><br></div><div>See remark (5) above.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<br>
-Jameson<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://cmake.3232098.n2.nabble.com/Question-regarding-External-Project-add-and-VTK-tp7587557p7587563.html" target="_blank">http://cmake.3232098.n2.nabble.com/Question-regarding-External-Project-add-and-VTK-tp7587557p7587563.html</a><br>


<div class=""><div class="h5">Sent from the CMake mailing list archive at Nabble.com.<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" 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" 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" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" 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" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br>
</div></div></div></div></div></div></div></div></div></div></div>