diff options
author | 7FM <41307817+7FM@users.noreply.github.com> | 2024-02-14 20:40:31 +0100 |
---|---|---|
committer | 7FM <41307817+7FM@users.noreply.github.com> | 2024-02-14 21:46:39 +0100 |
commit | e784a317a793aa7702e9abcf87921ccfd9cb875f (patch) | |
tree | fbbb4ce76d0516017396ab3497d6cc0e368bd366 | |
parent | f1c2dbad1c9674f82e61b7cf76cdc618a2dba852 (diff) |
CMake: add find_package support
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
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 + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + $<INSTALL_INTERFACE:include>) 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 |