[CMake] problems (again) finding boost on Windows MSVC 64 bit

Sergiu Dotenco sergiu.dotenco at gmail.com
Fri Jul 8 11:55:10 EDT 2011


Am 08.07.2011 16:53, schrieb Dominik Szczerba:
> Hi,
> 
> Anytime I touch boost, cmake (2.8.4) fails to find it. Why is it so fragile?
> 
> This time it would not find boost static build while it would find a
> shared one (the last time it was the exact opposite).
> I am quite overwhelmed by the required variables, I count 7 of them:
> BOOST_ROOT, BOOST_LIBRARYDIR, Boost_INCLUDE_DIR, Boost_LIBRARY_DIRS,
> Boost_THREAD_LIBRARY, Boost_THREAD_LIBRARY_DEBUG,
> Boost_THREAD_LIBRARY_RELEASE.
> 
> I keep setting them to the right values to keep receiving the same
> error message:
> 
> CMake Error at C:/Program Files (x86)/CMake
> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:1128 (message):
>   Unable to find the requested Boost libraries.
> 
>   Boost version: 1.46.1
> 
>   Boost include path: P:/boost-1.46.1-static/x64/include/boost-1_46_1
> 
>   The following Boost libraries could not be found:
> 
>           boost_thread
> 
>   No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
>   directory containing Boost libraries or BOOST_ROOT to the location of
>   Boost.
> 
> Is anyone able to clear the confusion?

If you compile Boost using default bjam settings, only two variables
have to be specified: BOOST_ROOT and Boost_USE_STATIC_LIBS. When using
static libraries, setting

option(Boost_USE_STATIC_LIBS "Use static Boost libraries" ON)

should be sufficient. Also, you might want to set the
Boost_ADDITIONAL_VERSIONS variable to "1.46.1", since 1.46 is the last
version known to FindBoost.cmake when using cmake 2.8.4.


More information about the CMake mailing list