From 8cf8ef6178659ee3aa59d16fcff4012f2df6f425 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 17 Oct 2022 00:15:20 +0200 Subject: Naively added components to install targets --- ArchiveEx/CMakeLists.txt | 7 ++++++- CMakeLists.txt | 6 +++++- Starserver/CMakeLists.txt | 7 ++++++- Starshatter/CMakeLists.txt | 7 ++++++- cmake/modules/InstallResource.cmake | 6 +++++- contrib/CMakeLists.txt | 7 ++++++- data/CMakeLists.txt | 2 ++ 7 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ArchiveEx/CMakeLists.txt b/ArchiveEx/CMakeLists.txt index 6010cea..99ea254 100644 --- a/ArchiveEx/CMakeLists.txt +++ b/ArchiveEx/CMakeLists.txt @@ -25,4 +25,9 @@ if(WIN32) PRIVATE -l:libshlwapi.a ) endif() -install(TARGETS dat RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) +install( + TARGETS dat + RUNTIME + COMPONENT Runtime + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68c1938..6903cda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,4 +33,8 @@ add_custom_target( BYPRODUCTS version COMMAND ${CMAKE_COMMAND} -E echo "${STARSHATTER_VERSION}" >version ) -install(FILES NOTICE COPYING DESTINATION ${CMAKE_INSTALL_PREFIX}) +install( + FILES NOTICE COPYING + COMPONENT Copyright + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) diff --git a/Starserver/CMakeLists.txt b/Starserver/CMakeLists.txt index 779b494..43e3d29 100644 --- a/Starserver/CMakeLists.txt +++ b/Starserver/CMakeLists.txt @@ -15,4 +15,9 @@ target_link_libraries( Starserver PRIVATE StarsEx ) -install(TARGETS Starserver RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) +install( + TARGETS Starserver + RUNTIME + COMPONENT Runtime + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) diff --git a/Starshatter/CMakeLists.txt b/Starshatter/CMakeLists.txt index 2501825..913685f 100644 --- a/Starshatter/CMakeLists.txt +++ b/Starshatter/CMakeLists.txt @@ -18,4 +18,9 @@ target_sources( Starshatter PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/Starshatter.rc ) -install(TARGETS Starshatter RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) +install( + TARGETS Starshatter + RUNTIME + COMPONENT Runtime + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) diff --git a/cmake/modules/InstallResource.cmake b/cmake/modules/InstallResource.cmake index 2b3176e..2c443cd 100644 --- a/cmake/modules/InstallResource.cmake +++ b/cmake/modules/InstallResource.cmake @@ -13,16 +13,20 @@ function(install_resource) PARSE_ARGV 0 INSTALL_RESOURCE "" - "DESTINATION" + "DESTINATION;COMPONENT" "" ) if(NOT DEFINED INSTALL_RESOURCE_DESTINATION) set(INSTALL_RESOURCE_DESTINATION ${CMAKE_INSTALL_DATADIR}/) endif() + if(NOT DEFINED INSTALL_RESOURCE_COMPONENT) + set(INSTALL_RESOURCE_COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) + endif() foreach(RESOURCE_TARGET IN ITEMS ${INSTALL_RESOURCE_UNPARSED_ARGUMENTS}) get_property(RESOURCE_DIRECTORY TARGET ${RESOURCE_TARGET} PROPERTY RESOURCE_DIRECTORY) install( DIRECTORY ${RESOURCE_DIRECTORY}/ + COMPONENT ${INSTALL_RESOURCE_COMPONENT} DESTINATION ${INSTALL_RESOURCE_DESTINATION} ) endforeach() diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 6a1a89b..7a8371c 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -6,13 +6,18 @@ add_subdirectory(zlib) install( TARGETS png15 Opcode zlib RUNTIME + COMPONENT Runtime DESTINATION ${CMAKE_INSTALL_PREFIX} ) if(NOT MSVC) foreach(LIB IN ITEMS "libstdc++-6.dll" "libwinpthread-1.dll" "libgcc_s_dw2-1.dll") find_file(LIBRARY_${LIB} ${LIB} PATHS ${CMAKE_FIND_ROOT_PATH}/bin) if(LIBRARY_${LIB}) - install(PROGRAMS ${LIBRARY_${LIB}} DESTINATION ${CMAKE_INSTALL_PREFIX}) + install( + PROGRAMS ${LIBRARY_${LIB}} + COMPONENT Runtime + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) endif() endforeach() endif() diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index f8dbc47..026fb14 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -41,10 +41,12 @@ install( ${CMAKE_CURRENT_BINARY_DIR}/shatter.dat ${CMAKE_CURRENT_BINARY_DIR}/start.dat ${CMAKE_CURRENT_BINARY_DIR}/vox.dat + COMPONENT Resources DESTINATION ${CMAKE_INSTALL_PREFIX} ) install_resource( resource_vox_campaign resource_vox_music + COMPONENT Resources DESTINATION ${CMAKE_INSTALL_PREFIX}/ ) -- cgit v1.1