From 42e62779873cf9d307c678c8867288ad4441855b Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Sat, 12 Oct 2024 16:48:42 +0200 Subject: [PATCH 1/2] build: Add static libraries to Kernel install component --- src/kernel/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index 7bf8efc5167..b9a18bbcef3 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -123,7 +123,7 @@ if(NOT BUILD_SHARED_LIBS) # LIBS_PRIVATE is substituted in the pkg-config file. set(LIBS_PRIVATE "") foreach(lib ${all_kernel_static_link_libs}) - install(TARGETS ${lib} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(TARGETS ${lib} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Kernel) string(APPEND LIBS_PRIVATE " -l${lib}") endforeach() @@ -131,7 +131,7 @@ if(NOT BUILD_SHARED_LIBS) endif() configure_file(${PROJECT_SOURCE_DIR}/libbitcoinkernel.pc.in ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc @ONLY) -install(FILES ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +install(FILES ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT Kernel) include(GNUInstallDirs) install(TARGETS bitcoinkernel From 82e16e698321ea6fb69ce5a08b048347aab8c74e Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 15 Sep 2024 10:45:48 +0100 Subject: [PATCH 2/2] cmake: Refactor install kernel dependencies --- src/kernel/CMakeLists.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index b9a18bbcef3..6ea16e8a425 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -120,14 +120,10 @@ if(NOT BUILD_SHARED_LIBS) set(all_kernel_static_link_libs "") get_target_static_link_libs(bitcoinkernel all_kernel_static_link_libs) + install(TARGETS ${all_kernel_static_link_libs} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Kernel) + list(TRANSFORM all_kernel_static_link_libs PREPEND "-l") # LIBS_PRIVATE is substituted in the pkg-config file. - set(LIBS_PRIVATE "") - foreach(lib ${all_kernel_static_link_libs}) - install(TARGETS ${lib} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Kernel) - string(APPEND LIBS_PRIVATE " -l${lib}") - endforeach() - - string(STRIP "${LIBS_PRIVATE}" LIBS_PRIVATE) + list(JOIN all_kernel_static_link_libs " " LIBS_PRIVATE) endif() configure_file(${PROJECT_SOURCE_DIR}/libbitcoinkernel.pc.in ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc @ONLY)