From e784a317a793aa7702e9abcf87921ccfd9cb875f Mon Sep 17 00:00:00 2001 From: 7FM <41307817+7FM@users.noreply.github.com> Date: Wed, 14 Feb 2024 20:40:31 +0100 Subject: CMake: add find_package support --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 290d201..c76b640 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,14 +90,21 @@ endif() # building project add_library(${PROJECT_NAME} ${SRC_LIST}) -target_include_directories(${PROJECT_NAME} PUBLIC include) +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $) target_link_libraries(${PROJECT_NAME} ${LIB_LIST}) include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(EXPORT ${PROJECT_NAME}-targets + NAMESPACE ${PROJECT_NAME}:: + FILE ${PROJECT_NAME}Config.cmake + DESTINATION lib/cmake/${PROJECT_NAME}) set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) # ABI version -- cgit v1.2.3