On 5/2/2018 4:47 AM, Petr Kmoch wrote:
Hi Stephane.

ExternalProject is designed to run at *build* time, not at *CMake* time. It is not really intended for mixing with normal, non-ExternalProject targets (such as those created by add_library).

When using ExternalProject, the canonical form of operation is a SuperBuild-style project: your master CMakeLists.txt will contain only ExternalProject_Add() calls, *including one for your normal project.* Your normal project becomes just another project managed by the SuperBuild. The SuperBuild's purpose is to download, configure, build, etc., all the subprojects. So you generate the SuperBuild and then build it once to get all the dependencies in place. The you switch to using just the YourProject "child" of the SuperBuild and do normal development there.

I think googling "CMake ExternalProject_Add superbuild" will give you enough details to get you going.

Another option can be found in the most recent CMake 3.11:

https://cmake.org/cmake/help/git-stage/module/FetchContent.html

That should do what you want. It can not build or configure like external project, but it can download at cmake time.

-Bill




--

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to