Skip to content

Commit

Permalink
Add COMPONENT to install targets
Browse files Browse the repository at this point in the history
dh-cmake is using components to aid DEB package creation.
  • Loading branch information
pawelwod committed Mar 14, 2023
1 parent 72a4bab commit 10fa358
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,33 +149,39 @@ if (SCN_INSTALL)

install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT scnlib_Development)

install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/src/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/scn/detail")
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/scn/detail"
COMPONENT scnlib_Development)

install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/README.md"
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
DESTINATION ${CMAKE_INSTALL_DATADIR}/scn)
DESTINATION ${CMAKE_INSTALL_DATADIR}/scn
COMPONENT scnlib_Development)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/scnConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/scnConfig.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/scn")
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/scn"
COMPONENT scnlib_Development)

export(TARGETS ${SCN_EXPORT_TARGETS_LIST}
NAMESPACE scn
FILE "${CMAKE_CURRENT_BINARY_DIR}/scnTargets.cmake")

install(TARGETS ${SCN_EXPORT_TARGETS_LIST}
COMPONENT scnlib_Development
EXPORT scnTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

install(EXPORT scnTargets
COMPONENT scnlib_Development
NAMESPACE scn::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/scn")
endif ()

0 comments on commit 10fa358

Please sign in to comment.