我用它来支持 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 仅将其用于 INCLUDE,而不是 LIB。用于 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