[CMake] Configuring targets & software that isn't yet built

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jul 26 15:52:34 EDT 2010


On Wednesday 21 July 2010, Brian Davis wrote:
> I too would like the answer to this and other questions.  I have been
> having the same problem with CMake (among others)
>
> How to build a project that contains multiple 3rd party sources where:



>
> 1) build of one package is dependent on the not yet installed install of a
> dependency package where the install of the dependency is part of the "uber
> project".  This occurs where all source of multiple 3rd party packages is
> contained in the source tree where it is checked out cleanly build on a
> build server or user machine and there is one CMakeLists.txt file which
> defines the project without having to call CMake multiple times for each
> project.
> 2) modularity in the use of add_subdirectory or as of yet a not net defined
> alternative in CMake where 3rd Party packages would not blast away each
> others global CMAKE_C_FLAGS due to the inevitalbe use by each 3rdParty
> project of CACHE STRING "" FORCE etc.  My desire for namespaces when
> add_subdirecoty is called or project(someproject) is called.
> EXTERNAL_PROJECT_ADD (though I am forced to do this for vtk, dcmtk, and
> VTKEdge) is not the solution (IMHO) for these issues as I am forced to
> build the entire project for only a few needed dependencies.  If you choose
> this route then use EXTERNAL_PROJECT_ADD for each project then use
> add_dependency  linking the projects in order of their dependencies.  This
> worked for me, but mileage may vary.

I'm doing something similar, but I hit a problem when adding the dependencies 
so that the external projects are actually built.
The issues is that it is currently not possible to use add_dependencies() with 
imported targets, here's the issue for it:
http://public.kitware.com/Bug/view.php?id=10395

Would that help in your case too ?

Alex


More information about the CMake mailing list