Add a CMake cache variable to pass arbitrary flags to the pkg-config
Libs line. This enables CGO builds using GCC (not g++) to link correctly
by allowing users to specify C++ stdlib dependencies.
Usage: cmake -DPKGCONFIG_EXTRA_LIBS="-lstdc++ -lm" ...
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)
+set(PKGCONFIG_EXTRA_LIBS "" CACHE STRING "Extra libraries to add to pkg-config Libs")
configure_file(libhs.pc.in libhs.pc @ONLY) # only replace @ quoted vars
install(FILES ${CMAKE_BINARY_DIR}/libhs.pc
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
Description: Intel(R) Chimera Library
Version: @HS_VERSION@
Requires.private: libhs
-Libs: -L${libdir} -lchimera
+Libs: -L${libdir} -lchimera @PKGCONFIG_EXTRA_LIBS@
Libs.private: @PRIVATE_LIBS@
Cflags: -I${includedir}/hs
Name: libhs
Description: A portable fork of the high-performance regular expression matching library
Version: @HS_VERSION@
-Libs: -L${libdir} -lhs
+Libs: -L${libdir} -lhs @PKGCONFIG_EXTRA_LIBS@
Cflags: -I${includedir}/hs