【发布时间】:2019-05-14 23:03:08
【问题描述】:
在 OSX 上,我已经使用 brew install boost 安装了 Boost,我正在尝试如下链接:
cmake_minimum_required(VERSION 3.13)
project(LinkBoost)
set(CMAKE_CXX_STANDARD 14)
add_executable(LinkBoost
desmond.cpp
desmond.h
integration.cpp
integration.h
main.cpp
main.h
utillity.cpp
utillity.h)
list(APPEND CMAKE_PREFIX_PATH "/usr/local/Cellar/boost/1.69.0_2")
set(Boost_ADDITIONAL_VERSIONS "1.69.0" "1.69")
find_package(BoostCOMPONENTS filesystem system test REQUIRED)
target_include_directories(LinkBoost PUBLIC ".")
# adds include directories, definitions and link libraries
target_link_libraries(VelocityDispersion PUBLIC
Boost::filesystem Boost::system Boost::test)
然而这给了我:
Unable to find the requested Boost libraries.
Boost version: 1.69.0
Boost include path: /usr/local/Cellar/boost/1.69.0_2/include
Could not find the following Boost libraries:
boost_test
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
谁能帮我理解这里出了什么问题?我觉得我错过了一些明显的东西......
【问题讨论】:
-
Boost.Test 框架有几个不同的usage variants。您能否验证 Boost.Test 库是否已安装在您的系统上,可能与其他
libboost_Boost 库一起安装,例如libboost_system、libboost_filesystem等。