]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
pkgconfig: Add Libs.private for static linking
authorMatthew Barr <matthew.barr@intel.com>
Wed, 27 Apr 2016 05:05:44 +0000 (15:05 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 24 May 2016 01:26:06 +0000 (11:26 +1000)
CMakeLists.txt
libhs.pc.in

index 10a7b359c3ed1d741f9d54f9928b5459f372ac29..7439f50b8513bb568bde9e522e960598361b108c 100644 (file)
@@ -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")
index b67f9de6bb8cfb1838c9b1d0746cd11363dec4da..e16460e881e3dd1626b1f7d2849b7f271c5c7845 100644 (file)
@@ -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