[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Question regarding External Project add and VTK
From:       Jean-Christophe Fillion-Robin <jchris.fillionr () kitware ! com>
Date:       2014-06-03 6:29:07
Message-ID: CANLz8R5GDBr5HkxB8eUebMZE-hNzvLCb8xBrZ3GWAQm5ero3Kg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Jameson,

That is indeed the idea.


To clarify even further,

1) the call to

   ExternalProject_Include_Dependencies [1]

should be added before "ExternalProject_Add".  It  will recursively include
the needed dependencies.


2) By simply adding an additional parameter:

    by default ${<project_name>_EP_ARGS}

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.


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.


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.


5) To debug, it is possible to uncomment line referenced in [4]


6) The yet to be integrated module "ExternalProjectForNonCMakeProject"
could also be useful. See [5]


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: https://github.com/commontk/Artichoke/issues

Hth
Jc

[1]
https://github.com/Slicer/Slicer/blob/45bba0632e37239be3ae3d2ca4b5cf0833dbe4fc/SuperBuild/External_VTKv6.cmake#L11


[2]
https://github.com/Slicer/Slicer/blob/45bba0632e37239be3ae3d2ca4b5cf0833dbe4fc/SuperBuild/External_VTKv6.cmake#L100


[3]
http://cmake-artichoke.readthedocs.org/en/latest/ExternalProjectDependency.html#function:ExternalProject_Include_Dependencies


[4]
https://github.com/commontk/Artichoke/blob/b0cf6fc85d5a490dc5a10a8f4a319678151722d2/ExternalProjectDependency.cmake#L671-675


[5] https://github.com/commontk/Artichoke/issues/7


On Tue, Jun 3, 2014 at 1:49 AM, jmerkow <jmerkow@gmail.com> wrote:

> Jc,
> 
> Thanks a lot this may be exactly what I am looking for.
> 
> Basically I include ExternalProjectDependency in my project, then
> mark_as_superbuild() options/vars that I want to pass back to the 'normal'
> build.  Add the external project with 'CMAKE_CACHE_ARGS' and this will pass
> those variables to the build (assuming that it has the same name).  Then as
> long as a lib is contained in '${${PROJECT_NAME}_DEPENDS}' it will be
> loaded
> from the Externals dir (set(EXTERNAL_PROJECT_DIR
> ${CMAKE_CURRENT_SOURCE_DIR}/TheExternals)), similar to the FindPackage(lib)
> mechanic.
> Does this sum it up?
> 
> I've added a few mark_as_superbuild to my project is there an easy way to
> list out what variables will me passed?
> 

See remark (5) above.


> 
> -Jameson
> 
> 
> 
> --
> View this message in context:
> http://cmake.3232098.n2.nabble.com/Question-regarding-External-Project-add-and-VTK-tp7587557p7587563.html
>  Sent from the CMake mailing list archive at Nabble.com.
> --
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 



-- 
+1 919 869 8849


[Attachment #5 (text/html)]

<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 \
&quot;ExternalProject_Add&quot;.   It   will recursively include the needed \
dependencies.<br>

<br><br>2) By simply adding an additional parameter:<br><br>       by default \
${&lt;project_name&gt;_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&#39;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 &quot;return()&quot; 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 \
&quot;ExternalProjectForNonCMakeProject&quot; 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/S \
uperBuild/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/S \
uperBuild/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/ExternalProjectDepen \
dency.html#function:ExternalProject_Include_Dependencies">http://cmake-artichoke.readt \
hedocs.org/en/latest/ExternalProjectDependency.html#function:ExternalProject_Include_Dependencies</a><br>


<br>[4] <a href="https://github.com/commontk/Artichoke/blob/b0cf6fc85d5a490dc5a10a8f4a \
319678151722d2/ExternalProjectDependency.cmake#L671-675">https://github.com/commontk/A \
rtichoke/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">&lt;<a \
href="mailto:jmerkow@gmail.com" target="_blank">jmerkow@gmail.com</a>&gt;</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 \
&#39;normal&#39;<br> build.   Add the external project with \
&#39;CMAKE_CACHE_ARGS&#39; 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 \
&#39;${${PROJECT_NAME}_DEPENDS}&#39; 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&#39;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>



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic