[CMake] cmake 2.6.4 won't find boost 1.40 on windows

Michael Jackson mike.jackson at bluequartz.net
Thu Sep 17 17:21:06 EDT 2009


When you build boost use the --prefix=C:\boost_1_40 ... install

also you should specify toolset==msvc9.0 or the libraries will not be  
named correctly.

Mike Jackson

On Sep 17, 2009, at 4:48 PM, Cristian Adam wrote:

> Hi,
>
> I have encountered problems with Boost 1.40 (build on Windows using
> Visual Studio 2008 and MinGW GCC 4.4.0) with CMake 2.6.4.
>
> Boost was compiled for Visual Studio 2008 like this:
> bjam --build-dir=c:\temp\boost toolset=msvc --build-type=complete  
> install
> and for MinGW GCC like this:
> bjam --build-dir=c:\temp\boost toolset=gcc --build-type=complete  
> install
>
> Adding set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0") didn't fix the
> problem.
>
> The problem is due to the fact that Boost 1.40 was installed to
> c:\boost\include\boost-1_40\ and according to FindBoost.cmake module  
> lines 292 to 300:
>
>     FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
>       # Add in a path suffix, based on the required version, ideally
>       # we could read this from version.hpp, but for that to work we'd
>       # need to know the include dir already
>       if (WIN32 AND NOT CYGWIN)
>         set(_boost_PATH_SUFFIX boost_${_boost_VER})
>       else (WIN32 AND NOT CYGWIN)
>         set(_boost_PATH_SUFFIX boost-${_boost_VER})
>       endif (WIN32 AND NOT CYGWIN)
>
> Boost should have been installed into c:\boost\include\boost_1_40\.
>
> Was Boost before version 1.40 installed into "boost_1_3x" for Visual  
> Studio and MinGW?
> If so how should version 1.40 be detected for Visual Studio and MinGW?
>
> I have tested two solutions to this problem:
>
> 1. rename c:\boost\include\boost-1_40\ to c:\boost\include\boost_1_40\
> 2. use set(BOOST_INCLUDEDIR "c:/boost/include/boost-1_40"
>
> The following cmake change:
> http://www.cmake.org/pipermail/cmake-commits/2009-August/006975.html
> will remove the "set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0")"  
> statement but it won't fix the
> underscore problem for Visual Studio and MinGW Boost compilations!
>
> Cheers,
> Cristian.



More information about the CMake mailing list