[CMake] ExternalProject_Add and Boost

Ben Medina ben.medina at gmail.com
Mon Jun 18 14:33:27 EDT 2012


That's right. You can pass various initial cache entries, such as
BOOST_ROOT, via the CMAKE_CACHE_ARGS parameter to ExternalProject_Add.

A useful example of this is the Titan project:
http://www.kitware.com/InfovisWiki/index.php/Main_Page
You can see how it builds VTK as an external project, forcing it to
use the externally-built Boost via cache arguments.

On Mon, Jun 18, 2012 at 11:03 AM, Knox, Kent <Kent.Knox at amd.com> wrote:
> That is an interesting approach; if this 'superbuild' cmake project downloaded and built all the external dependencies first, then my project could find those dependencies with the appropriate find module?  I suppose that the 'superbuild' could set the BOOST_ROOT variable (or other appropriate variables) for my real project.  I'll play around with this idea when I get some time, thanks for the comment!
>
> -----Original Message-----
> From: Ben Medina [mailto:ben.medina at gmail.com]
> Sent: Monday, June 18, 2012 11:59 AM
> To: Knox, Kent
> Cc: cmake at cmake.org
> Subject: Re: [CMake] ExternalProject_Add and Boost
>
>> 4.       ExternalProject_Add will download, configure and build projects at
>> 'build' time.  From the documentation, this sounded like a design decision.
>> However, this means that you can't use the already robust and mature
>> findboost() module to configure the Boost project.  Would it be
>> possible to add support to ExternalProject_Add to work at 'configure' time?
>
> The approach that seems most common is to create a "superbuilder"
> project that builds your dependencies as external projects, then builds your own project (also as an external project) at the end.
>
>
>


More information about the CMake mailing list