MantisBT - CMake
View Issue Details
0012205CMakeCMakepublic2011-05-18 11:212016-06-10 14:31
Thomas Roehr 
Philip Lowman 
normalminoralways
closedmoved 
Linux
CMake-2-6 
 
0012205: FindBoost cannot handle parallel boost installations - Fixed version attached
FindBoost.cmake cannot handle multiple boost versions. It does not pick the include directory correctly, i.e. the version of the include directory does not correspond to the version of the library directory. Example (/usr and custom dir, here: /opt)
boost 1.40 installed in /usr/ and 1.44 in /opt/boost/
Setting BOOST_ROOT to /opt/boost or alternatively BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to /opt/boost/include and /opt/boost/lib/ will result in:
Boost_INCLUDE_DIR -> /opt/boost/include and Boost_LIBRARY_DIR -> /usr/lib and Boost_SYSTEM_LIBRARIES .. /usr/lib/libboost..

Install boost into /usr/ and into /opt/boost, export BOOST_ROOT=/opt/boost or BOOST_INCLUDEDIR=/opt/boost/include, BOOST_LIBRARYDIR)/opt/boost/lib and run a CMake project with

find_package(Boost 1.38 COMPONENTS filesystem system unit_test_framework thread serialization)

message(${Boost_INCLUDE_DIRS})
message(${Boost_LIBRARY_DIRS})

Attached the update FindBoost.cmake version that first searches the provided path with NO_DEFAULT option and has a fallback to the DEFAULT path search. It also provides full path information on the found libraries.
No tags attached.
? FindBoost.cmake (44,201) 2011-05-18 11:21
https://public.kitware.com/Bug/file/3882/FindBoost.cmake
Issue History
2011-05-18 11:21Thomas RoehrNew Issue
2011-05-18 11:21Thomas RoehrFile Added: FindBoost.cmake
2011-05-19 11:22Thomas RoehrNote Added: 0026553
2011-05-26 00:44Philip LowmanAssigned To => Philip Lowman
2011-05-26 00:44Philip LowmanStatusnew => assigned
2011-05-26 00:55Philip LowmanNote Added: 0026610
2011-05-26 06:36Thomas RoehrNote Added: 0026614
2016-06-10 14:28Kitware RobotNote Added: 0041841
2016-06-10 14:28Kitware RobotStatusassigned => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0026553)
Thomas Roehr   
2011-05-19 11:22   
Correction: applies to cmake-2.8
(0026610)
Philip Lowman   
2011-05-26 00:55   
Tom,

Thanks for filing the issue and attaching your modifications.

I believe the cause for your problems is the same as is explained in 11465 and is more of an issue with find_library().

Can you try using the latest FindBoost (with CMake 2.8.4) and setting Boost_NO_SYSTEM_PATHS (I believe 2.8.3 also supports the option) to see if this works around your problem?

FindBoost has changed dramatically since the version you attached so any patches would need to be against a newer version if they still are needed.
(0026614)
Thomas Roehr   
2011-05-26 06:36   
This issue does indeed correspond to 11465, though here I also want to point out, that user defined locations are ignored.

With 2.8.4 BOOST_ROOT finds the correct libraries, when Boost_NO_SYSTEM_PATHS is set. Actually, my changes made it the default to first search in user defined locations and then fallback to including the system defaults.

However, I would assume that users only specify BOOST_ROOT when a custom installation is required and at the same time not all users of the same package might need this. Thus it will then be a good idea to either have Boost_NO_SYSTEM_PATH being set dynamically as soon as BOOST_ROOT is provided (preferred) or also allow control of this setting via an environmental variable.
(0041841)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.