Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/pcre/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: pcre
Version: 8.44
Port-Version: 7
Port-Version: 8
Homepage: https://www.pcre.org/
Description: Perl Compatible Regular Expressions
25 changes: 25 additions & 0 deletions ports/pcre/export-cmake-targets.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 252de6e..bcef3ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -885,10 +885,19 @@ ENDIF(PCRE_BUILD_TESTS)
# Installation
SET(CMAKE_INSTALL_ALWAYS 1)

-INSTALL(TARGETS ${targets}
+foreach(target ${targets})
+ INSTALL(TARGETS ${target}
+ EXPORT pcre-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
+ target_include_directories(${target} PUBLIC $<INSTALL_INTERFACE:include>)
+endforeach()
+
+INSTALL(EXPORT pcre-targets
+ NAMESPACE unofficial::pcre::
+ FILE unofficial-pcre-targets.cmake
+ DESTINATION "share/unofficial-pcre")

INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)

9 changes: 7 additions & 2 deletions ports/pcre/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set(PATCHES
# Fix CMake Deprecation Warning concerning OLD behavior for policy CMP0026
# Suppress MSVC compiler warnings C4703, C4146, C4308, which fixes errors
# under x64-uwp and arm-uwp
pcre-8.44_suppress_cmake_and_compiler_warnings-errors.patch)
pcre-8.44_suppress_cmake_and_compiler_warnings-errors.patch
export-cmake-targets.patch)

vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.pcre.org/pub/pcre/pcre-${PCRE_VERSION}.zip"
Expand Down Expand Up @@ -53,6 +54,8 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT})

foreach(FILE ${CURRENT_PACKAGES_DIR}/include/pcre.h ${CURRENT_PACKAGES_DIR}/include/pcreposix.h)
file(READ ${FILE} PCRE_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
Expand Down Expand Up @@ -121,6 +124,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)

vcpkg_copy_pdbs()
configure_file(${CMAKE_CURRENT_LIST_DIR}/unofficial-pcre-config.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-pcre/unofficial-pcre-config.cmake @ONLY)

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

vcpkg_copy_pdbs()
1 change: 1 addition & 0 deletions ports/pcre/unofficial-pcre-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-pcre-targets.cmake")