[CMake] Boost on Windows

Michael Jackson mike.jackson at bluequartz.net
Tue Jun 23 14:21:23 EDT 2009


I use the boost pre-compiled all the time and I don't have any of  
these issues BUT I do set the BOOST_ROOT environment variable in "My  
Computer->Advanced Settings" after I install which may be the  
difference. I use threads, program_options, testing, filesystem and  
system.

I did notice in the FindBoost that there is a subtle difference in how  
the directory names are generated:

I think one has boost_1_38 while another has boost-1_38 depending on  
windows or unix.

 From FindBoost.cmake in CMake version 2.6.4 around line 460


list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
if(WIN32)
# For BoostPro's underscores (and others?)
   list(APPEND _boost_PATH_SUFFIXES "boost_$ 
{_boost_BOOSTIFIED_VERSION}")
endif()

Do you actually have the Dynamic multi-threaded boost libs installed?

Also, Looking at the CMakeLists.txt file it seems you are trying to  
parse the Boost_THREAD library variable for something? If you are  
trying to differentiate between the Release and Debug versions there  
are the following variables for each boost library.

Boost_PROGRAM_OPTIONS_LIBRARY
Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG
Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE

Any of that help?

_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Jun 23, 2009, at 1:35 PM, Curtis Rueden wrote:

> Hi Andreas,
>
> Well, then most probably the layout of that binary installation  
> differs
> from what the FindBoost.cmake file expects. So where is the boost  
> thread
> library and how is it named?
>
> The latest available version of Boost offered by BoostPro is v1.38.  
> The libraries are placed in:
>
>   C:\Program Files\boost\boost_1_38\lib
>
> The strange thing is that FindBoost *does* find Boost, but only if  
> first run with no arguments, followed by explicitly setting  
> BOOST_ROOT.
>
> Looking at this:
>
> > https://skyking.microscopy.wisc.edu/svn/java/trunk/components/native/bf-cpp/CMakeLists.txt
>
> The layout of that package seems to be utterly broken.
>
> Do you mean bf-cpp, or some other package? How is it "broken"? I am  
> new to the CMake way of doing things, so would appreciate any advice  
> for improvement.
>
> Thanks,
> Curtis
>
> On Tue, Jun 23, 2009 at 1:26 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 23.06.09 13:09:25, Curtis Rueden wrote:
> > First, I installed Boost using BoostPro's precompiled binaries at
> > http://www.boostpro.com/download.
> >
> > Then I tried the following CMakeLists.txt file:
> >
> > ----------
> > # Simple CMake build file for testing FindBoost. Fails on Windows  
> with
> > # Boost binaries from BoostPro computing (http://www.boostpro.com/).
> >
> > cmake_minimum_required(VERSION 2.6)
> >
> > project(boostFail1)
> >
> > message(STATUS "-- Boost:")
> > set(Boost_USE_STATIC_LIBS OFF)
> > set(Boost_USE_MULTITHREAD ON)
> >
> > find_package(Boost COMPONENTS thread REQUIRED)
> >
> > message(STATUS "Boost_INCLUDE_DIR    : ${Boost_INCLUDE_DIR}")
> > message(STATUS "Boost_THREAD_LIBRARY : ${Boost_THREAD_LIBRARY}")
> > ----------
> >
> > The error message I see is:
> >
> > ----------
> > -- Boost:
> > CMake Error at C:/Program Files/CMake
> > 2.6/share/cmake-2.6/Modules/FindBoost.cmake:868 (message):
> >   Unable to find the requested Boost libraries.
> >
> >   Boost version: 1.38.0
> >
> >   Boost include path: C:/Program Files/boost/boost_1_38
> >
> >   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.
> > Call Stack (most recent call first):
> >   CMakeLists.txt:16 (find_package)
> >
> >
> > Boost_INCLUDE_DIR    : C:/Program Files/boost/boost_1_38
> > Boost_THREAD_LIBRARY : Boost_THREAD_LIBRARY-NOTFOUND
> > ----------
> >
> > The problem does not occur on Linux or Mac OS X.
>
> Well, then most probably the layout of that binary installation  
> differs
> from what the FindBoost.cmake file expects. So where is the boost  
> thread
> library and how is it named? Looking at this:
>
> > https://skyking.microscopy.wisc.edu/svn/java/trunk/components/native/bf-cpp/CMakeLists.txt
>
> The layout of that package seems to be utterly broken.
>
> Andreas
>
>



More information about the CMake mailing list