Windows下cmake配置boost库

cmake_minimum_required(VERSION 3.14)
project(boost_python)

set(CMAKE_CXX_STANDARD 11)

set(BOOST_ROOT D:/Libraries/boost_1_69_0)
find_package(BOOST 1.69.0 COMPONENTS thread)
if(Boost_FOUND)
    message(Boost_INCLUDE_DIRS " ${Boost_INCLUDE_DIRS}")
    message(Boost_LIBRARY_DIRS " ${Boost_LIBRARY_DIRS}")
    include_directories(${Boost_INCLUDE_DIRS})
    link_directories(${Boost_LIBRARY_DIRS})
    add_executable(boost_python main.cpp)
endif()

官方文档:https://cmake.org/cmake/help/latest/command/find_package.html#version-selection

你可能感兴趣的:(boost)