FindBoost.cmake does not support boost::type_index in the COMPONENTS field
I am unable to use find_package
to find the Boost::TypeIndex library, getting the following warnings/errors:
CMake Warning at /home/mitch/.local/share/cmake-3.15/Modules/FindBoost.cmake:1984 (message):
No header defined for type_index; skipping header check
....
CMake Error at /home/mitch/.local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Boost (missing: type_index) (found suitable version
"1.69.0", minimum required is "1.69")
Call Stack (most recent call first):
/home/mitch/.local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/mitch/.local/share/cmake-3.15/Modules/FindBoost.cmake:2142 (find_package_handle_standard_args)
src/CMakeLists.txt:6 (find_package)
The cmake version I am using:
$ cmake --version
cmake version 3.15.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
The CMake I wrote to find and link the TypeIndex library:
find_package( Boost 1.69 COMPONENTS type_index REQUIRED )
target_link_libraries( ${CMAKE_PROJECT_NAME} PRIVATE Boost::type_index )
I have confirmed that the boost/type_index.hpp
header exists in my include path. Replacing type_index
with type_erasure
works, for example. Inspection of FindBoost.cmake
seems to indicate that this component was not explicitly handled.