[CMake] Question regarding External Project add and VTK

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Tue Jun 3 02:29:07 EDT 2014


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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140603/d6d6a3d3/attachment-0001.html>


More information about the CMake mailing list