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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions libfswatch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,17 @@ if (USE_NLS)
endif ()
endif ()

target_include_directories(libfswatch PUBLIC src/libfswatch)
target_include_directories(libfswatch PUBLIC src)
target_include_directories(libfswatch PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>)
target_include_directories(libfswatch PUBLIC ${Intl_INCLUDE_DIRS})
target_include_directories(libfswatch PRIVATE ${PROJECT_BINARY_DIR})
target_include_directories(libfswatch PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
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.

NAMESPACE libfswatch::
FILE libfswatch-config.cmake)
# TODO: should migrate to target_source(file_set) to install headers
install(DIRECTORY src/libfswatch
DESTINATION include
Expand Down