From 126cd438e1a5ffc259ddcf2d5621f5e7cd08e364 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Sat, 28 Jan 2023 22:25:37 -0500 Subject: [PATCH] Cmake install components --- CMakeLists.txt | 2 -- src/CMakeLists.txt | 4 +++- src/app/CMakeLists.txt | 5 ++++- src/qtk/CMakeLists.txt | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e0e3d7..cc37ce7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,9 +124,7 @@ endif() set(ASSIMP_BUILD_TESTS OFF CACHE STRING "Do not build assimp tests." FORCE) set(ASSIMP_INSTALL ON CACHE STRING "Use assimp as a submodule." FORCE) set(ASSIMP_WARNINGS_AS_ERRORS OFF CACHE STRING "No warnings as errors." FORCE) -set(ASSIMP_INJECT_DEBUG_POSTFIX OFF CACHE STRING "Do not postfix assimp with -dev" FORCE) set(BUILD_SHARED_LIBS OFF CACHE STRING "Build static assimp libs" FORCE) -set(ASSIMP_OPT_BUILD_PACKAGES ON CACHE STRING "Build static assimp libs" FORCE) if(QTK_UPDATE_SUBMODULES) message(STATUS "[Qtk] Updating submodules...") submodule_update("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7c9d6e4..42b03dc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,12 +26,14 @@ install( FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + COMPONENT libqtk DESTINATION lib/cmake/${PROJECT_NAME} ) install( EXPORT qtk_export FILE ${PROJECT_NAME}Targets.cmake NAMESPACE ${PROJECT_NAME}:: + COMPONENT libqtk DESTINATION lib/cmake/${PROJECT_NAME} ) @@ -47,7 +49,7 @@ set(CPACK_PACKAGE_CONTACT "shaunreed.com") #set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/icon.png") set(CPACK_THREADS 0) set(CPACK_PACKAGE_INSTALL_DIRECTORY "Qtk") -set(CPACK_COMPONENTS_ALL Unspecified) + # Debian set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PACKAGE_HOMEPAGE_URL}) set(CPACK_INSTALL_SCRIPTS ${QTK_DEPLOY_SCRIPT}) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index bf040a5..d6b768b 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -33,6 +33,7 @@ target_link_libraries(qtk_plugin_library PUBLIC Qt6::UiPlugin qtk_library) install( TARGETS qtk_plugin_library + COMPONENT qtk_collection LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static RUNTIME DESTINATION bin @@ -61,6 +62,7 @@ target_link_libraries(qtk_collection PUBLIC qtk_plugin_library) install( TARGETS qtk_collection + COMPONENT qtk_collection LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static RUNTIME DESTINATION bin @@ -110,6 +112,7 @@ set_target_properties( install( TARGETS qtk_main + COMPONENT qtk BUNDLE DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static @@ -121,7 +124,7 @@ qt_generate_deploy_app_script( FILENAME_VARIABLE QTK_DEPLOY_SCRIPT NO_UNSUPPORTED_PLATFORM_ERROR ) -install(SCRIPT ${QTK_DEPLOY_SCRIPT}) +install(SCRIPT ${QTK_DEPLOY_SCRIPT} COMPONENT qtk) if(WIN32) if(MSVC AND TARGET Qt6::qmake) diff --git a/src/qtk/CMakeLists.txt b/src/qtk/CMakeLists.txt index 4804f3c..2cc13fa 100644 --- a/src/qtk/CMakeLists.txt +++ b/src/qtk/CMakeLists.txt @@ -83,6 +83,7 @@ install( TARGETS qtk_library # Associate qtk_library target with qtk-export EXPORT qtk_export + COMPONENT libqtk FILE_SET HEADERS DESTINATION include INCLUDES DESTINATION include LIBRARY DESTINATION lib