When using CMake's package config file to add the library to a project using find_package the include directory is not referenced, making it impossible to include mstch.hpp in your own project.
To fix this, modify src/CMakeLists.txt from this:
install(
TARGETS mstch EXPORT mstchTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
To this:
install(
TARGETS mstch EXPORT mstchTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
INCLUDES DESTINATION include)
This tells CMake to set the INTERFACE_INCLUDE_DIRECTORIES property on the target to ${CMAKE_INSTALL_PREFIX}/include, allowing you to #include <mstch/mstch.hpp>.
When using CMake's package config file to add the library to a project using
find_packagethe include directory is not referenced, making it impossible to includemstch.hppin your own project.To fix this, modify
src/CMakeLists.txtfrom this:To this:
This tells CMake to set the
INTERFACE_INCLUDE_DIRECTORIESproperty on the target to${CMAKE_INSTALL_PREFIX}/include, allowing you to#include <mstch/mstch.hpp>.