[CMake] [CMake General][FindBoost] CMake and Boost 1.46.1

Robert Nelson boardmaster357 at gmail.com
Sun May 1 01:23:00 EDT 2011


I have used CMake for a while under Linux, but until recently never
really tried to make CMakelists truly cross platform.  I would like to
use CMake with Boost 1.46.1 under windows 7
I installed boost by downloading the zip and running:
bootstrap.bat
bjam
bjam install

I am using the CMake 2.84 GUI

Here is my CMakelists.txt



PROJECT(schema)
cmake_minimum_required(VERSION 2.6)

SET( Boost_NO_SYSTEM_PATHS true )
SET( BOOST_INCLUDEDIR "C:/Boost/include/boost-1_46_1" )
SET( BOOST_LIBRARYDIR "C:/Boost/lib" )
find_package(Boost 1.46 COMPONENTS regex program_options pthread
filesystem REQUIRED)

link_directories(${Boost_LIBRARY_DIRS} )
include_directories( ${Boost_INCLUDE_DIRS} )

#if you don't want the full compiler output, remove the following line
SET(CMAKE_VERBOSE_MAKEFILE ON)

add_executable(schema
main.cpp
...
)

INSTALL_TARGETS(/bin schema)


The error I get is:

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: C:/Boost/include/boost-1_46_1

  The following Boost libraries could not be found:

          boost_regex
          boost_program_options
          boost_pthread
          boost_filesystem

  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:11 (find_package)

Any help would be greatly appreciated.

Thanks
--Robert Nelson


More information about the CMake mailing list