这是我的CMakeList.txt文件:
set(Boost_NO_SYSTEM_PATHS ON)
set(BOOST_ROOT $ENV{HOME}/Downloads/boost_1_60_0)
set(BOOST_INCLUDEDIR ${BOOST_ROOT})
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/bin.v2/libs)
find_package(Boost 1.60.0 COMPONENTS chrono context filesystem graphParallel iOStreams locale mpi program_options regex serialization signals system thread timer wave date_time graph math random test exception)
message("Boost_LIBRARIES:${Boost_LIBRARIES}")
include_directories(${BOOST_INCLUDEDIR})
这是我的提升目录结构:
roroco@roroco-Zhaoyang-K49 ~/Downloads/boost_1_60_0 $ lsa
total 708
drwx------ 10 roroco roroco 4096 Feb 16 23:10 .
drwx------ 20 roroco roroco 24576 Feb 16 23:10 ..
-rwxr-xr-x 1 roroco roroco 263256 Feb 16 23:01 b2
drwxr-xr-x 4 roroco roroco 4096 Feb 16 23:10 bin.v2
-rwxr-xr-x 1 roroco roroco 263256 Feb 16 23:01 bjam
drwxr-xr-x 106 roroco roroco 12288 Dec 14 22:12 boost
-rw-r--r-- 1 roroco roroco 850 Dec 14 10:30 boost-build.jam
-rw-r--r-- 1 roroco roroco 21920 Dec 14 10:30 boostcpp.jam
-rw-r--r-- 1 roroco roroco 989 Dec 14 10:30 boost.css
-rw-r--r-- 1 roroco roroco 6308 Dec 14 10:30 boost.png
-rw-r--r-- 1 roroco roroco 2477 Dec 14 10:30 bootstrap.bat
-rw-r--r-- 1 roroco roroco 909 Feb 16 23:01 bootstrap.log
-rwxr-xr-x 1 roroco roroco 10631 Dec 14 10:30 bootstrap.sh
drwx------ 7 roroco roroco 4096 Dec 14 22:12 doc
-rw-r--r-- 1 roroco roroco 769 Dec 14 10:30 index.htm
-rw-r--r-- 1 roroco roroco 5472 Dec 14 10:30 index.html
-rw-r--r-- 1 roroco roroco 291 Dec 14 10:30 INSTALL
-rw-r--r-- 1 roroco roroco 10779 Dec 14 10:30 Jamroot
drwx------ 117 roroco roroco 4096 Dec 14 22:12 libs
-rw-r--r-- 1 roroco roroco 1338 Dec 14 10:30 LICENSE_1_0.txt
drwxr-xr-x 4 roroco roroco 4096 Dec 14 10:30 more
-rw-r--r-- 1 roroco roroco 928 Feb 16 23:01 project-config.jam
-rw-r--r-- 1 roroco roroco 976 Feb 16 22:28 project-config.jam.1
-rw-r--r-- 1 roroco roroco 1000 Feb 16 22:29 project-config.jam.2
-rw-r--r-- 1 roroco roroco 928 Feb 16 22:51 project-config.jam.3
-rw-r--r-- 1 roroco roroco 928 Feb 16 23:00 project-config.jam.4
-rw-r--r-- 1 roroco roroco 2608 Dec 14 10:30 rst.css
drwxr-xr-x 3 roroco roroco 4096 Feb 16 22:28 stage
drwxr-xr-x 2 roroco roroco 4096 Dec 14 10:30 status
drwxr-xr-x 10 roroco roroco 4096 Dec 14 10:30 tools
-rw-r--r-- 1 roroco roroco 30 Feb 16 22:59 user-config.jam
roroco@roroco-Zhaoyang-K49 ~/Downloads/boost_1_60_0 $ lsa bin.v2
total 28
drwxr-xr-x 4 roroco roroco 4096 Feb 16 23:10 .
drwx------ 10 roroco roroco 4096 Feb 16 23:10 ..
-rw-r--r-- 1 roroco roroco 7957 Feb 16 23:10 config.log
drwxr-xr-x 27 roroco roroco 4096 Feb 16 23:17 libs
-rw-r--r-- 1 roroco roroco 3030 Feb 16 23:10 project-cache.jam
drwxr-xr-x 3 roroco roroco 4096 Feb 16 23:10 standalone
lrwxrwxrwx 1 roroco roroco 19 Feb 16 23:10 test-symlink -> test-symlink-source
-rw-r--r-- 1 roroco roroco 0 Feb 16 23:10 test-symlink-source
更新
cmake
输出为:
in /tmp/home/roroco/Dropbox/cs/ro-c
cmake /home/roroco/Dropbox/cs/ro-c
-- Could NOT find Boost
-- Could NOT find Boost
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/home/roroco/Dropbox/cs/ro-c
答案 0 :(得分:0)
当我在cmake中set(Boost_DEBUG 1)
时,输出显示我在find_package中添加了不存在的组件,我可以在/ home / roroco / Downloads / boost_1_60_0 / stage / lib中找到所有组件名称,所以新的find_package是
find_package(Boost 1.60.0 COMPONENTS atomic filesystem math_c99l program_options thread random timer chrono graph math_c99 regex type_erasure math_tr1 container locale math_tr1f serialization unit_test_framework context log math_tr1l log_setup signals wave coroutine system wserialization prg_exec_monitor date_time math_c99f test_exec_monitor exception)