Imported target "Boost::program_options" includes non-existent path
When using find_package
to search for boost and providing some optional COMPONENTS
CMake exits with an error.
This seems to be a regression since it used to work just fine.
Relevant lines in CMakeLists.txt
:
set (Boost_DEBUG 1)
find_package(Boost 1.71 REQUIRED COMPONENTS program_options filesystem)
target_include_directories (xyz PUBLIC ${CMAKE_SOURCE_DIR}/include ${Boost_INCLUDE_DIRS})
target_link_libraries(xyz PUBLIC ${Boost_LIBRARIES})
...
Output:
cmake -v .
-- Found Boost 1.71.0 at /lib64/cmake/Boost-1.71.0
-- Requested configuration: QUIET REQUIRED COMPONENTS program_options;filesystem
-- BoostConfig: find_package(boost_headers 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /lib64/cmake)
-- Found boost_headers 1.71.0 at /lib64/cmake/boost_headers-1.71.0
-- BoostConfig: find_package(boost_program_options 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /lib64/cmake)
-- Found boost_program_options 1.71.0 at /lib64/cmake/boost_program_options-1.71.0
-- Boost toolset is gcc9 (GNU 9.2.0)
-- Scanning /lib64/cmake/boost_program_options-1.71.0/libboost_program_options-variant*.cmake
-- Including /lib64/cmake/boost_program_options-1.71.0/libboost_program_options-variant-shared.cmake
-- [x] libboost_program_options.so.1.71.0
-- Including /lib64/cmake/boost_program_options-1.71.0/libboost_program_options-variant-static.cmake
-- [ ] libboost_program_options.a
-- Adding boost_program_options dependencies: headers
-- BoostConfig: find_package(boost_filesystem 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /lib64/cmake)
-- Found boost_filesystem 1.71.0 at /lib64/cmake/boost_filesystem-1.71.0
-- Boost toolset is gcc9 (GNU 9.2.0)
-- Scanning /lib64/cmake/boost_filesystem-1.71.0/libboost_filesystem-variant*.cmake
-- Including /lib64/cmake/boost_filesystem-1.71.0/libboost_filesystem-variant-shared.cmake
-- [x] libboost_filesystem.so.1.71.0
-- Including /lib64/cmake/boost_filesystem-1.71.0/libboost_filesystem-variant-static.cmake
-- [ ] libboost_filesystem.a
-- Adding boost_filesystem dependencies: headers
-- Configuring done
CMake Error in src/CMakeLists.txt:
Imported target "Boost::program_options" includes non-existent path
"/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
CMake Error in src/CMakeLists.txt:
Imported target "Boost::program_options" includes non-existent path
"/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
This is on Arch Linux using the current cmake package version 3.15.4-1
and boost 1.71.0-2
.