Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake package config does not reference include directory #23

Open
SamVanheer opened this issue Apr 21, 2018 · 0 comments
Open

CMake package config does not reference include directory #23

SamVanheer opened this issue Apr 21, 2018 · 0 comments

Comments

@SamVanheer
Copy link

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>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant