[CMake] How to depend on external cmake projects?

Tamás Kenéz tamas.kenez at gmail.com
Mon Aug 24 12:26:33 EDT 2015


On Mon, Aug 17, 2015 at 5:17 PM, James Johnston <JamesJ at motionview3d.com>
wrote:

> [...] Your own CMake projects will be
> ExternalProjects to this high-level project and the superbuild would pass
> the location to your project via -D<project>_DIR=<location> so that
> find_package can locate the Config file.
>

I think a more convenient and also more conforming solution would be to
pass the location of a single install directory
(-DCMAKE_INSTALL_PREFIX=...) and pass the same dir also as prefix path
(-DCMAKE_PREFIX_PATH=...) to all projects.
All the projects of the superbuild will search for dependencies (config
modules) in this directory and also install their own config modules into
this directory.
This directory is best to create inside the superbuild dir (like
<superbuild-root>/out) and of course removed from source control.
CMAKE_PREFIX_PATH may additionally contain other, central locations for
other libraries built outside of the superbuild.

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150824/4db74f69/attachment.html>


More information about the CMake mailing list