build: Add a pkg-config file for libbitcoinkernel

pull/30814/head
TheCharlatan 2 months ago
parent 45be32f838
commit 0dd16d7118
No known key found for this signature in database
GPG Key ID: 9B79B45691DB4173

@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: @PACKAGE_NAME@ kernel library
Description: Experimental library for the Bitcoin Core validation engine.
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lbitcoinkernel
Libs.private: -L${libdir} @LIBS_PRIVATE@
Cflags: -I${includedir}

@ -119,11 +119,19 @@ if(NOT BUILD_SHARED_LIBS)
set(all_kernel_static_link_libs "") set(all_kernel_static_link_libs "")
get_target_static_link_libs(bitcoinkernel all_kernel_static_link_libs) get_target_static_link_libs(bitcoinkernel all_kernel_static_link_libs)
# LIBS_PRIVATE is substituted in the pkg-config file.
set(LIBS_PRIVATE "")
foreach(lib ${all_kernel_static_link_libs}) foreach(lib ${all_kernel_static_link_libs})
install(TARGETS ${lib} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS ${lib} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
string(APPEND LIBS_PRIVATE " -l${lib}")
endforeach() endforeach()
string(STRIP "${LIBS_PRIVATE}" LIBS_PRIVATE)
endif() 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")
include(GNUInstallDirs) include(GNUInstallDirs)
install(TARGETS bitcoinkernel install(TARGETS bitcoinkernel
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

Loading…
Cancel
Save