Я установил libboost-all-dev
, упакованный в Ubuntu.
Cmake 3.10.2 может найти повышение, но не "boost_core
".
Когда я изменяю строку поиска пакета на:
find_package(Boost REQUIRED COMPONENTS core)
Тогда он жалуется, что не может найти "boost_core
".
Мне просто нужно boost/iterator
...
Как заставить cmake найти это?
Спасибо.
CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(test_boost_iterator)
set(CMAKE_CXX_STANDARD 11)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
add_definitions( "-DHAS_BOOST" )
add_executable(test_boost_iterator main.cpp)
Сообщение об успехе (перед заменой строки find_package
):
-- Boost version: 1.65.1
-- Configuring done
-- Generating done
Сообщение об ошибке (после замены строки find_package
)
Unable to find the requested Boost libraries.
Boost version: 1.65.1
Boost include path: /usr/include
Could not find the following Boost libraries:
boost_core
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)