aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Stöggl <c72578@yahoo.de>2020-06-05 21:24:03 +0200
committerGitHub <noreply@github.com>2020-06-05 12:24:03 -0700
commitb800df0e3bd3f3bc7f0903506e1ea62fec8e3db6 (patch)
treecf08d4b8fbbf276e1457f5f7e747b0ca6d2a21f8
parentaccac885d8f87943fd9f6daeae811d3bbe2dabb9 (diff)
downloadvcpkg-b800df0e3bd3f3bc7f0903506e1ea62fec8e3db6.tar.gz
vcpkg-b800df0e3bd3f3bc7f0903506e1ea62fec8e3db6.zip
[pcre] Add pkgconfig files (#11564)
* [pcre] Add pkgconfig files * [pcre] Install *.pc files on all platforms
-rw-r--r--ports/pcre/CONTROL2
-rw-r--r--ports/pcre/portfile.cmake49
2 files changed, 50 insertions, 1 deletions
diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL
index 58e40065d..4626a33b3 100644
--- a/ports/pcre/CONTROL
+++ b/ports/pcre/CONTROL
@@ -1,4 +1,4 @@
Source: pcre
-Version: 8.44
+Version: 8.44-1
Homepage: https://www.pcre.org/
Description: Perl Compatible Regular Expressions
diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake
index 546494087..903d82a76 100644
--- a/ports/pcre/portfile.cmake
+++ b/ports/pcre/portfile.cmake
@@ -50,6 +50,55 @@ foreach(FILE ${CURRENT_PACKAGES_DIR}/include/pcre.h ${CURRENT_PACKAGES_DIR}/incl
file(WRITE ${FILE} "${PCRE_H}")
endforeach()
+# Create pkgconfig files
+set(PACKAGE_VERSION ${PCRE_VERSION})
+set(prefix "${CURRENT_INSTALLED_DIR}")
+set(exec_prefix "\${prefix}")
+set(libdir "\${prefix}/lib")
+set(includedir "\${prefix}/include")
+if(VCPKG_TARGET_IS_LINUX)
+ # Used here in .pc.in files: Libs.private: @PTHREAD_CFLAGS@
+ set(PTHREAD_CFLAGS "-pthread")
+endif()
+
+configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre16.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre32.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcrecpp.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcreposix.pc" @ONLY)
+
+# debug
+set(prefix "${CURRENT_INSTALLED_DIR}/debug")
+set(exec_prefix "\${prefix}")
+set(libdir "\${prefix}/lib")
+set(includedir "\${prefix}/../include")
+
+configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc" @ONLY)
+configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc" @ONLY)
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc LIBPCRE.PC)
+ string(REPLACE "-lpcre" "-lpcred" LIBPCRE.PC ${LIBPCRE.PC})
+ file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc ${LIBPCRE.PC})
+ file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc LIBPCRE16.PC)
+ string(REPLACE "-lpcre16" "-lpcre16d" LIBPCRE16.PC ${LIBPCRE16.PC})
+ file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc ${LIBPCRE16.PC})
+ file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc LIBPCRE32.PC)
+ string(REPLACE "-lpcre32" "-lpcre32d" LIBPCRE32.PC ${LIBPCRE32.PC})
+ file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc ${LIBPCRE32.PC})
+ file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc LIBPCRECPP.PC)
+ string(REPLACE "-lpcre -lpcrecpp" "-lpcred -lpcrecppd" LIBPCRECPP.PC ${LIBPCRECPP.PC})
+ file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc ${LIBPCRECPP.PC})
+ file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc LIBPCREPOSIX.PC)
+ string(REPLACE "-lpcreposix" "-lpcreposixd" LIBPCREPOSIX.PC ${LIBPCREPOSIX.PC})
+ file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc ${LIBPCREPOSIX.PC})
+endif()
+
+vcpkg_fixup_pkgconfig()
+
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)