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

Tom Vercauteren tom.vercauteren at m4x.org
Wed Nov 10 10:50:58 EST 2010


On Wed, Nov 10, 2010 at 16:36, Brad King <brad.king at kitware.com> wrote:
> On 11/10/2010 09:40 AM, Tom Vercauteren wrote:
>> I would love to see something like that happen, and I think that
>> relying on boost TR1 implementation is the way to go. Indeed according
>> to the documentation, boost TR1 can be used transparently. For the
>> user (once things are correctly configured), there is absolutely no
>> difference in whether we use boost's TR1 or the compiler's TR:
>>   http://www.boost.org/doc/libs/1_44_0/doc/html/boost_tr1/usage.html#boost_tr1.usage.writing_code
>> One example, we will not use the boost namespace but the std::tr1 one.
>>
>> I admit that it will require some work to make the setup seamless but
>> it should be doable and using the bcp tool might help:
>>   http://www.boost.org/doc/libs/1_44_0/tools/bcp/doc/html/index.html
>
> 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.

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
    fetch and configure boost tr1 using cmake ExternalProject_Add and maybe bcp
  else
    use local boost tr1
  end
else
  use system tr1
end

Does this make sense?

Tom


>
> -Brad K
>


More information about the Insight-developers mailing list