Install headers more elegantly.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
49b2117f13
commit
9337964266
|
@ -45,7 +45,6 @@ else()
|
|||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(pkg-config)
|
||||
add_subdirectory(cmake)
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
include(GNUInstallDirs)
|
||||
|
||||
install(FILES "xdgcfg.hpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
|
@ -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}")
|
||||
|
|
Reference in New Issue
Block a user