[Insight-developers] Adding std::tr1 to ITK?

Brad King brad.king at kitware.com
Wed Nov 10 11:36:27 EST 2010


On 11/10/2010 10:50 AM, Tom Vercauteren wrote:
> On Wed, Nov 10, 2010 at 16:36, Brad King <brad.king at kitware.com> wrote:
>> Copying Boost headers into ITK will cause future problems for those
>> that try to build applications involving both ITK and Boost.  One
>> goal of the ITK Modularization effort is to be able to depend on
>> Boost as a 3rd-party library *without* copying it into ITK/Utilities.
>> That will allow applications to use both libraries cleanly.
> 
> Indeed, I was not proposing to copy the headers into the ITK
> repository. I think we should however try to make the process as easy
> as possible. That is, we should try not to require the users to
> install boost if they don't already have it.

This should be the job of the modularization / packaging infrastructure
used to build ITK modules.  Ideally boost will be made available before
CMake even starts running on ITK.

> Could something like that be done with the ExternalProject_Add command
> from cmake? I was thinking of the following pseudo code:
> 
> if not system has tr1
>   if not found local boost install

There is no distinction between "system" and "local install".  Both are
outside of our build.

>     fetch and configure boost tr1 using cmake ExternalProject_Add and maybe bcp

One problem with this approach is that the headers and libraries will
not even exist while CMake is configuring ITK.  CMake will not be able
to generate link rules to bring in the libraries by full path unless
we memorize where ExternalProject_Add will put them on every platform.

Generally the ExternalProject module is useful for "superbuilds" where
the only code depending on the output of an external project build is
in another external project build.

This is why we have traditionally used the Utilities/$dep approach with
an ITK_USE_SYSTEM_$dep option.  Each dependency is either provided ahead
of time or built as part of the project.  In both cases the library
file locations are known to the targets that depend on them.

-Brad


More information about the Insight-developers mailing list