MantisBT - CMake
View Issue Details
0007303CMakeModulespublic2008-07-08 07:302008-07-08 09:47
Alexander Bubnov 
Douglas Gregor 
normalminoralways
closedno change required 
CMake-2-6 
CMake-2-6 
0007303: CMake latest: Boost_LIBRARIES is not set
cmake/CMakeExample> cat CMakeLists.txt
cmake_minimum_required(VERSION 2.6)

project (trial)
find_package(Boost)
message("Boost_LIBRARIES: " ${Boost_LIBRARIES})

cmake/CMakeExample> rm CMakeCache.txt ; cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.33.1
-- Found the following Boost libraries:
Boost_LIBRARIES:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alek/trial/cmake/CMakeExample

As you can see Boost_LIBRARIES is empty, but

man cmake says:

Boost_LIBRARIES Link these to use the Boost libraries that you specified, not cached
No tags attached.
txt CMakeLists.txt (121) 2008-07-08 07:30
https://public.kitware.com/Bug/file/1585/CMakeLists.txt
Issue History
2008-07-08 07:30Alexander BubnovNew Issue
2008-07-08 07:30Alexander BubnovFile Added: CMakeLists.txt
2008-07-08 09:23Alexander BubnovNote Added: 0012650
2008-07-08 09:35Bill HoffmanStatusnew => assigned
2008-07-08 09:35Bill HoffmanAssigned To => Douglas Gregor
2008-07-08 09:47Douglas GregorStatusassigned => closed
2008-07-08 09:47Douglas GregorNote Added: 0012654
2008-07-08 09:47Douglas GregorResolutionopen => no change required
2008-07-08 09:47Douglas GregorFixed in Version => CMake-2-6

Notes
(0012650)
Alexander Bubnov   
2008-07-08 09:23   
it would be greate if the fix of this bug can be in latest.
(0012654)
Douglas Gregor   
2008-07-08 09:47   
This is expected behavior. Boost_LIBRARIES gives you the libraries you need to link against, but it only does so if you've asked the Boost module to find specific libraries, e.g., "filesystem", using the COMPONENTS argument to FindPackage:

  find_package(Boost COMPONENTS filesystem)