diff --git a/CMakeLists.txt b/CMakeLists.txt index 027ea74..b1d8789 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,6 @@ else() endif() add_subdirectory(src) -add_subdirectory(include) add_subdirectory(pkg-config) add_subdirectory(cmake) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt deleted file mode 100644 index 8f19bfa..0000000 --- a/include/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -include(GNUInstallDirs) - -install(FILES "xdgcfg.hpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ee11633..22bf814 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,11 +4,13 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(libxdg-basedir REQUIRED IMPORTED_TARGET libxdg-basedir) pkg_check_modules(libconfig++ REQUIRED IMPORTED_TARGET libconfig++) -add_library(${PROJECT_NAME} "xdgcfg.cpp" "../include/xdgcfg.hpp") +set(${PROJECT_NAME}_public_headers "../include/xdgcfg.hpp") +add_library(${PROJECT_NAME} "xdgcfg.cpp" "${${PROJECT_NAME}_public_headers}") set_target_properties(xdgcfg PROPERTIES VERSION ${PROJECT_VERSION} - SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}) + SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR} + PUBLIC_HEADER "${${PROJECT_NAME}_public_headers}") target_include_directories(${PROJECT_NAME} PUBLIC @@ -22,4 +24,5 @@ target_link_libraries(${PROJECT_NAME} install(TARGETS ${PROJECT_NAME} EXPORT "${PROJECT_NAME}Targets" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")