1

私はこれを使ってBOOSTを見つけました:

set(Boost_DEBUG 1)
find_package( Boost 1.52 COMPONENTS system filesystem REQUIRED )
message(${Boost_LIBRARIES})

Cmake は、別のフォルダーにインストールしたBOOST 1.52ライブラリを見つけますが、次の場所にあるシステムBOOST 1.41ライブラリとリンクしています/usr

BOOST_ROOTが設定されていますが、cmake は LIB ではなく INCLUDE にのみ使用します。BOOST の Cmake デバッグ出力。

-- [ /usr/share/cmake/Modules/FindBoost.cmake:347 ] Boost not in cache
-- [ /usr/share/cmake/Modules/FindBoost.cmake:350 ] _boost_TEST_VERSIONS = 
-- [ /usr/share/cmake/Modules/FindBoost.cmake:352 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake/Modules/FindBoost.cmake:354 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/share/cmake/Modules/FindBoost.cmake:412 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake/Modules/FindBoost.cmake:414 ]   BOOST_ROOT = /gpfs/res_apps/BOOST/1.52.0
-- [ /usr/share/cmake/Modules/FindBoost.cmake:416 ]   BOOST_INCLUDEDIR = 
-- [ /usr/share/cmake/Modules/FindBoost.cmake:418 ]   BOOST_LIBRARYDIR = 
-- [ /usr/share/cmake/Modules/FindBoost.cmake:420 ] _boost_TEST_VERSIONS = 
-- [ /usr/share/cmake/Modules/FindBoost.cmake:469 ] Include debugging info:
-- [ /usr/share/cmake/Modules/FindBoost.cmake:471 ]   _boost_INCLUDE_SEARCH_DIRS = /gpfs/res_apps/BOOST/1.52.0/include;/gpfs/res_apps/BOOST/1.52.0;C:/boost/include;C:/boost;/boost;/sw/local/include
-- [ /usr/share/cmake/Modules/FindBoost.cmake:473 ]   _boost_PATH_SUFFIXES = 
-- [ /usr/share/cmake/Modules/FindBoost.cmake:497 ] location of version.hpp: /gpfs/res_apps/BOOST/1.52.0/include/boost/version.hpp
-- [ /usr/share/cmake/Modules/FindBoost.cmake:516 ] version.hpp reveals boost 1.52.0
-- [ /usr/share/cmake/Modules/FindBoost.cmake:602 ] guessed _boost_COMPILER = -gcc47
-- [ /usr/share/cmake/Modules/FindBoost.cmake:612 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake/Modules/FindBoost.cmake:628 ] _boost_STATIC_TAG = 
-- [ /usr/share/cmake/Modules/FindBoost.cmake:630 ] _boost_ABI_TAG = d
-- [ /usr/share/cmake/Modules/FindBoost.cmake:659 ] _boost_LIBRARIES_SEARCH_DIRS = /gpfs/res_apps/BOOST/1.52.0/lib;/gpfs/res_apps/BOOST/1.52.0/stage/lib;C:/boost/lib;C:/boost;/boost/boost_1_52_0/lib;/boost;/sw/local/lib
-- [ /usr/share/cmake/Modules/FindBoost.cmake:788 ] Boost_FOUND = TRUE
-- Boost version: 1.52.0
-- Found the following Boost libraries:
--   system
--   filesystem
/usr/lib64/libboost_system-mt.so/usr/lib64/libboost_filesystem-mt.so
4

0 に答える 0