How to find Boost 1.40.0 with cmake 2.6?
Hi, maybe this is a bit off-topic as it is probably a cmake problem, but it could turn out that the correct solution also involves suitable invocation of bjam. As there seems to be no Windows/VC9.0 installer for Boost 1.40.0 (yet), I have built and installed the libraries myself as follows: ...\boost_1_40_0> bootstrap ...\boost_1_40_0> .\bjam --prefix=C:\Programme\boost\boost_1_40_0 ...\boost_1_40_0> .\bjam --prefix=C:\Programme\boost\boost_1_40_0 install Now, there is the following tree in C:\Programme\boost: C:\Programme\boost +-boost_1_40_0 +-include | +-boost-1_40 | +-boost | +.... +-lib +-libboost....-vc90-mt-1_40.lib +-... What is the correct way to teach the FindBoost module in cmake where to search for the boost installation? I have found that I need to at least set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0") However, cmake does not yet find Boost. According to the debugging output of the module, the situation seems to improve slightly when I additionally specify set(BOOST_ROOT C:/Programme/boost) Now, cmake reports "Boost version: 1.40.0" but does not find any libraries. Would I have to supply different options to bjam in order to find the libraries? Is it possible to avoid having to specify BOOST_ROOT in the CMakeLists.txt file? TIA for your support! Ingolf
You probably want to send this type of query to the CMake user list. See below for a tip. On Sep 18, 2009, at 8:50 AM, Ingolf Steinbach wrote:
What is the correct way to teach the FindBoost module in cmake where to search for the boost installation?
I have found that I need to at least set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0")
However, cmake does not yet find Boost. According to the debugging output of the module, the situation seems to improve slightly when I additionally specify set(BOOST_ROOT C:/Programme/boost)
Set the BOOST_ROOT variable as an environment variable, not in your CMakeLists.txt file. Alternatively, set the BOOST_ROOT variable in your CMakeLists.txt using: set( ENV{BOOST_ROOT} <path> ) I hope this helps. If not, take the issue up on the CMake user list.
Hi Ingolf, On 09/18/2009 05:50 PM, Ingolf Steinbach wrote: [snip]
I have found that I need to at least set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0")
[snip]
Is it possible to avoid having to specify BOOST_ROOT in the CMakeLists.txt file? [snip]
Yes, according to my experience you need Boost_ADDITIONAL_VERSIONS set as you do, and the option -DBOOST_ROOT=/path/to/boost on the command line to cmake. This works for me. Cheers, Mikko
On Fri, Sep 18, 2009 at 8:20 AM, Mikko Vainio
Yes, according to my experience you need Boost_ADDITIONAL_VERSIONS set as you do, and the option -DBOOST_ROOT=/path/to/boost on the command line to cmake. This works for me.
Also, the only libraries that are "found" are ones that are (a) compiled, such as date_time or filesystem, and (b) requested in the find_package command: find_package(Boost 1.40.0 COMPONENTS date_time filesystem system) to link to these you'll need to add: target_link_libraries(foo ${Boost_LIBRARIES}) check the source for FindBoost.cmake in your CMake installation for more information. HTH, Christopher
Thanks to all who responded. I found that there is a similar thread in
the cmake mailing list ("cmake 2.6.4 won't find boost 1.40 on
windows"). Let's continue discussion of cmake configuration there as
already suggested by James.
2009/9/18 Ingolf Steinbach
Would I have to supply different options to bjam in order to find the libraries?
Back to boost: are there recommendations with respect to "suitable"/"reasonable"/typical choices for --prefix on windows? Ingolf
Ingolf Steinbach wrote:
Thanks to all who responded. I found that there is a similar thread in the cmake mailing list ("cmake 2.6.4 won't find boost 1.40 on windows"). Let's continue discussion of cmake configuration there as already suggested by James.
2009/9/18 Ingolf Steinbach
: Would I have to supply different options to bjam in order to find the libraries?
Back to boost: are there recommendations with respect to "suitable"/"reasonable"/typical choices for --prefix on windows?
It does not really matter. C:/Boost will be fine if you prefer short names. C:/Documents And Settings/Vladimir/Local/boost might be what I'd use. - Volodya
participants (5)
-
Christopher Currie
-
Ingolf Steinbach
-
James C. Sutherland
-
Mikko Vainio
-
Vladimir Prus