Use Boost from CMake in vcpkg project

In this particular case I’m using program_options:

cmake_minimum_required (VERSION 3.8)

find_package(Boost REQUIRED COMPONENTS program_options)

add_executable (bt "bt.cpp")
target_include_directories(${PROJECT_NAME} PRIVATE ${Boost_INCLUDE_DIRS})
target_link_libraries(bt Boost::program_options)

now #include <boost/program_options.hpp> works.


To contact me, send an email anytime or leave a comment below.