cmake: Refactor install kernel dependencies

This commit is contained in:
Hennadii Stepanov 2024-09-15 10:45:48 +01:00 committed by TheCharlatan
parent 42e6277987
commit 82e16e6983
No known key found for this signature in database
GPG key ID: 9B79B45691DB4173

View file

@ -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)