From: Matthew Barr Date: Wed, 27 Apr 2016 05:05:44 +0000 (+1000) Subject: pkgconfig: Add Libs.private for static linking X-Git-Tag: v4.2.0^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e52783017eeb6093a8bac160d6125d658664eebb;p=thirdparty%2Fvectorscan.git pkgconfig: Add Libs.private for static linking --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 10a7b359..7439f50b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -349,6 +349,14 @@ configure_file(${CMAKE_MODULE_PATH}/config.h.in ${PROJECT_BINARY_DIR}/config.h) configure_file(src/hs_version.h.in ${PROJECT_BINARY_DIR}/hs_version.h) if (NOT WIN32) + # expand out library names for pkgconfig static link info + foreach (LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}) + # this is fragile, but protects us from toolchain specific files + if (NOT EXISTS ${LIB}) + set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}") + endif() + endforeach() + configure_file(libhs.pc.in libhs.pc @ONLY) # only replace @ quoted vars install(FILES ${CMAKE_BINARY_DIR}/libhs.pc DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") diff --git a/libhs.pc.in b/libhs.pc.in index b67f9de6..e16460e8 100644 --- a/libhs.pc.in +++ b/libhs.pc.in @@ -7,4 +7,5 @@ Name: libhs Description: Intel(R) Hyperscan Library Version: @HS_VERSION@ Libs: -L${libdir} -lhs +Libs.private: @PRIVATE_LIBS@ Cflags: -I${includedir}/hs