[Insight-users] Fwd: using boost with ITK

Michael Jackson mike.jackson at bluequartz.net
Wed Jan 13 13:06:46 EST 2010


This is what I do when using boost:

I install boost into C:\Developer\i386\boost_1_41

The naming on that is VERY important as that is the directory that  
FindBoost.cmake looks for on Windows.

Now, in your CMakeLists.txt file I have the following:
# ---------- Find Boost Headers/Libraries -----------------------
SET (Boost_FIND_REQUIRED TRUE)
SET (Boost_FIND_QUIETLY TRUE)
set (Boost_USE_MULTITHREADED TRUE)
set (Boost_USE_STATIC_LIBS TRUE)
SET (Boost_ADDITIONAL_VERSIONS "1.41" "1.41.0" "1.39" "1.39.0")


if ( NOT MXA_BOOST_HEADERS_ONLY)
  set (MXA_BOOST_COMPONENTS program_options )
endif()

FIND_PACKAGE(Boost COMPONENTS  ${MXA_BOOST_COMPONENTS} )
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})


And lastly in my environment I have the following set:

BOOST_ROOT=C:\Developer\i386\boost_1_41

Then from a clean build directory I can run cmake to configure my  
project. These settings work for my systems (Windows 7 x64, Visual  
Studio 9) and OS X 10.5 and Linux Ubuntu 09.10. YMMV

Hope that helps
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net


On Jan 13, 2010, at 12:49 PM, Mathieu Malaterre wrote:

> [better on cmake mailing list]
>
> On Wed, Jan 13, 2010 at 6:44 PM, Mark Roden <mmroden at gmail.com> wrote:
>> Hi Mike,
>>
>> I've downloaded Boost 1.41 and run the bootstrap.bat file to build it
>> on Windows.
>>
>> With CMake 2.8, I get the error:
>> Could NOT find Boost
>>
>> after I set boost_INCLUDE_DIR to be where I downloaded the boost
>> libraries.  Additionally, the other parameters (debug and release
>> versions of the filesystem and system libraries) automatically reset
>> to blank when that error shows up.
>>
>> What am I missing?
>
>
> $ cmake --help-module FindBoost
> ...
>
>    Currently this module searches for the following version numbers:
>       1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0,  
> 1.35.1,
>       1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39,  
> 1.39.0, 1.40,
>       1.40.0
> ...
>     These last three variables are available also as environment
>       variables:
>
>          BOOST_ROOT or BOOSTROOT      The preferred installation
> prefix for searching for
>                                       Boost.  Set this if the module
> has problems finding
>                                       the proper Boost installation.
>
> ...
>
>
> what this means is that 1.41 is not a 'known' version. Either get
> FindBoost from CMake CVS or use BOOST_ROOT.
>
> 2cts
> -- 
> Mathieu
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list