Eike, I have changed the version from 1.46 to 1.46.0 and removed the link_directories() command, then run the command as follows:
$ cmake -DBoost_DEBUG=On ~/GITROOT/BGLCMakeQuestion -- 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 -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:468 ] Boost not in cache -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:471 ] _boost_TEST_VERSIONS = 1.46.1;1.46.0;1.46 -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:473 ] Boost_USE_MULTITHREADED = TRUE -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:475 ] Boost_USE_STATIC_LIBS = -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:477 ] Boost_USE_STATIC_RUNTIME = -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:479 ] Boost_ADDITIONAL_VERSIONS = -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:481 ] Boost_NO_SYSTEM_PATHS = -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:544 ] Declared as CMake or Environmental Variables: -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:546 ] BOOST_ROOT = -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:548 ] BOOST_INCLUDEDIR = -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:550 ] BOOST_LIBRARYDIR = -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:552 ] _boost_TEST_VERSIONS = 1.46.1;1.46.0;1.46 -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:605 ] Include debugging info: -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:607 ] _boost_INCLUDE_SEARCH_DIRS = C:/boost/include;C:/boost;/boost/include;/boost;/sw/local/include -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:609 ] _boost_PATH_SUFFIXES = boost-1_46_1;boost_1_46_1;boost-1_46_0;boost_1_46_0;boost-1_46;boost_1_46 -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:634 ] location of version.hpp: /usr/include/boost/version.hpp -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:653 ] version.hpp reveals boost 1.46.1 -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:744 ] guessed _boost_COMPILER = -gcc46 -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:754 ] _boost_MULTITHREADED = -mt -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:797 ] _boost_RELEASE_ABI_TAG = - -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:799 ] _boost_DEBUG_ABI_TAG = -d -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:842 ] _boost_LIBRARY_SEARCH_DIRS = /usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;C:/boost/lib;C:/boost;/boost/boost_1_46_1/lib;/boost/boost_1_46/lib;/boost/lib;/boost;/sw/local/lib -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:913 ] Searching for GRAPH_LIBRARY_RELEASE: boost_graph-gcc46-mt-1_46_1;boost_graph-gcc46-mt;boost_graph-mt-1_46_1;boost_graph-mt;boost_graph -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:945 ] Searching for GRAPH_LIBRARY_DEBUG: boost_graph-gcc46-mt-d-1_46_1;boost_graph-gcc46-mt-d;boost_graph-mt-d-1_46_1;boost_graph-mt-d;boost_graph-mt;boost_graph -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:913 ] Searching for REGEX_LIBRARY_RELEASE: boost_regex-gcc46-mt-1_46_1;boost_regex-gcc46-mt;boost_regex-mt-1_46_1;boost_regex-mt;boost_regex -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:945 ] Searching for REGEX_LIBRARY_DEBUG: boost_regex-gcc46-mt-d-1_46_1;boost_regex-gcc46-mt-d;boost_regex-mt-d-1_46_1;boost_regex-mt-d;boost_regex-mt;boost_regex -- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1055 ] Boost_FOUND = TRUE -- Boost version: 1.46.1 -- Found the following Boost libraries: -- graph -- regex -- Configuring done -- Generating done -- Build files have been written to: /home/ajg23/GITROOT/BGLCMakeQuestion/build Sorry, I still don't get it... On Wed, Feb 1, 2012 at 3:46 AM, Rolf Eike Beer <[email protected]> wrote: > > Hi all, > > > > I have been trying to compile a very simple example with cmake (2.8.5) > and > > boost, and I can't get what I am doing wrong... > > > > CMakeLists.txt > > ---------------------- > > > > cmake_minimum_required(VERSION 2.6) > > > > project(ReadGraph) > > > > find_package(Boost 1.46 COMPONENTS graph regex ) > > Maybe you need to add 1.46.0 here? > > > link_directories(${Boost_LIBRARY_DIRS}) > > This is wrong. You don't need link_directories(). > > > include_directories(BEFORE ${Boost_INCLUDE_DIRS}) > > > > add_executable(ReadGraph ReadGraph.cpp) > > target_link_libraries(ReadGraph ${Boost_LIBRARIES} ) > > # target_link_libraries(ReadGraph boost_graph boost_regex ) > > Please use a clean build directory and add "-D Boost_DEBUG=On" to your > command line. Then look at the configuration output. If you do not find > what's going wrong paste it here. > > Eike >
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
