I am on Windows 10, VS 2017. I installed boost with vcpkg install boost[locale-icu,regex-icu,python] --featurepackage
In my minimal downstream CMakeLists.txt
``````
cmake_minimum_required(VERSION 3.5)
project(Example)
find_package( Boost COMPONENTS python REQUIRED )
set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/main.cpp)
add_executable(${PROJECT_NAME} ${PROJECT_SRCS})
target_link_libraries(${PROJECT_NAME} Boost::python)
``````
main.cpp can be anything, cmake configuration failed with the below error message
``````
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1900 (message):
Unable to find the requested Boost libraries.
Boost version: 1.65.1
Boost include path: C:/vcpkg/installed/x64-windows/include
Could not find the following Boost libraries:
boost_python
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):
C:/vcpkg/scripts/buildsystems/vcpkg.cmake:159 (_find_package)
CMakeLists.txt:12 (find_package)
-- Configuring incomplete, errors occurred!
``````
But the fact is I have a boost_python3-vc141-mt-1_65_1 lying inside C:\vcpkg\installed\x64-windows\bin but for reason it is not able to discover it.
Most helpful comment
See https://gitlab.kitware.com/cmake/cmake/issues/16391