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

Install CMake package config file #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tamaskenez
Copy link

The PR amends the existing CMake install commands to also install a package configuration file.
In the client program the package can be located and used like this:

find_package(libfswatch ...)
...
target_link_libraries(... libfswatch::libfswatch ...)

Resolves #305

@tamaskenez tamaskenez changed the title Install CMake config Install CMake package config file Feb 11, 2023
target_link_libraries(libfswatch PRIVATE ${EXTRA_LIBS})

install(TARGETS libfswatch LIBRARY DESTINATION lib)
install(TARGETS libfswatch EXPORT libfswatch-export LIBRARY DESTINATION lib)
install(EXPORT libfswatch-export DESTINATION lib/cmake/libfswatch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

install(EXPORT libfswatch-export DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libfswatch

As it needs to be installed to /usr/lib64 on 64bit platforms.

I guess that other places need to be adjusted too. You need include(GNUInstallDirs) to get access to the variables.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll fix it if @emcrisostomo shows up.

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

Successfully merging this pull request may close these issues.

CMake package config file is not installed
3 participants