Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
1 change: 1 addition & 0 deletions ports/pcre/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)

file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

vcpkg_copy_pdbs()
10 changes: 10 additions & 0 deletions ports/pcre/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include(SelectLibraryConfigurations)
Comment thread
PhoebeHui marked this conversation as resolved.
Outdated

find_path(PCRE_INCLUDE_DIR pcre.h)
find_library(PCRE_LIBRARY_DEBUG NAMES pcred NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED)
find_library(PCRE_LIBRARY_RELEASE NAMES pcre NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED)

select_library_configurations(PCRE)

set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
set(PCRE_LIBRARIES ${PCRE_LIBRARY})
3 changes: 1 addition & 2 deletions ports/poco/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Source: poco
Version: 1.9.2
Port-Version: 4
Version: 1.10.1
Build-Depends: expat, libpq, pcre, sqlite3, zlib, libpng
Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems.
Homepage: https://github.com/pocoproject/poco
Expand Down
22 changes: 0 additions & 22 deletions ports/poco/find_pcre.patch

This file was deleted.

82 changes: 82 additions & 0 deletions ports/poco/fix_dependency.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b664afd..0d4670e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -457,15 +457,6 @@ install(
Devel
)

-if(POCO_UNBUNDLED)
- install(FILES cmake/FindPCRE.cmake
- DESTINATION "${PocoConfigPackageLocation}")
- install(FILES cmake/V39/FindEXPAT.cmake
- DESTINATION "${PocoConfigPackageLocation}/V39")
- install(FILES cmake/V313/FindSQLite3.cmake
- DESTINATION "${PocoConfigPackageLocation}/V313")
-endif()
-
message(STATUS "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator")
message(STATUS "${PROJECT_NAME} package version: ${PROJECT_VERSION}")
if(BUILD_SHARED_LIBS)
diff --git a/Data/SQLite/CMakeLists.txt b/Data/SQLite/CMakeLists.txt
index b52e2c5..0dcfae2 100644
--- a/Data/SQLite/CMakeLists.txt
+++ b/Data/SQLite/CMakeLists.txt
@@ -7,7 +7,7 @@ file(GLOB_RECURSE HDRS_G "include/*.h")
POCO_HEADERS_AUTO(SQLITE_SRCS ${HDRS_G})

if(POCO_UNBUNDLED)
- find_package(SQLite3 REQUIRED)
+ find_package(unofficial-sqlite3 CONFIG REQUIRED)
else()
# sqlite3
POCO_SOURCES(SQLITE_SRCS sqlite3
@@ -43,7 +43,7 @@ target_include_directories(DataSQLite
)

if(POCO_UNBUNDLED)
- target_link_libraries(DataSQLite PUBLIC SQLite::SQLite3)
+ target_link_libraries(DataSQLite PUBLIC unofficial::sqlite3::sqlite3)
target_compile_definitions(DataSQLite PUBLIC
POCO_UNBUNDLED
SQLITE_THREADSAFE=1
diff --git a/XML/CMakeLists.txt b/XML/CMakeLists.txt
index 4fbf06f..793285a 100644
--- a/XML/CMakeLists.txt
+++ b/XML/CMakeLists.txt
@@ -20,7 +20,7 @@ endif()
# If POCO_UNBUNDLED is enabled we try to find the required packages
# The configuration will fail if the packages are not found
if(POCO_UNBUNDLED)
- find_package(EXPAT REQUIRED)
+ find_package(expat CONFIG REQUIRED)
else()
POCO_SOURCES(SRCS expat
src/xmlparse.cpp
@@ -50,7 +50,7 @@ target_include_directories(XML
)

if(POCO_UNBUNDLED)
- target_link_libraries(XML PUBLIC EXPAT::EXPAT)
+ target_link_libraries(XML PUBLIC expat::expat)
target_compile_definitions(XML PUBLIC POCO_UNBUNDLED)
else()
if(WIN32)
diff --git a/cmake/PocoConfig.cmake.in b/cmake/PocoConfig.cmake.in
index 173eacd..589fdb6 100644
--- a/cmake/PocoConfig.cmake.in
+++ b/cmake/PocoConfig.cmake.in
@@ -8,6 +8,13 @@ if (NOT Poco_FIND_COMPONENTS)
return()
endif()

+include(CMakeFindDependencyMacro)
+find_dependency(ZLIB REQUIRED)
+find_dependency(PCRE REQUIRED)
+if(Poco_FIND_REQUIRED_XML)
+ find_dependency(EXPAT REQUIRED)
+endif()
+
set(_Poco_FIND_PARTS_REQUIRED)
if (Poco_FIND_REQUIRED)
set(_Poco_FIND_PARTS_REQUIRED REQUIRED)
24 changes: 0 additions & 24 deletions ports/poco/fix_foundation_link.patch

This file was deleted.

32 changes: 20 additions & 12 deletions ports/poco/include_pcre.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt
index 26a2365..0b8f7bc 100644
--- a/Foundation/CMakeLists.txt
+++ b/Foundation/CMakeLists.txt
@@ -168,6 +168,7 @@ target_link_libraries( "${LIBNAME}" ${SYSLIBS})
target_include_directories( "${LIBNAME}"
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${PCRE_INCLUDE_DIRS}>
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt
index 6b276be..0a3c63b 100644
--- a/Foundation/CMakeLists.txt
+++ b/Foundation/CMakeLists.txt
@@ -101,13 +101,14 @@ set_target_properties(Foundation
)

if(POCO_UNBUNDLED)
- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB)
+ target_link_libraries(Foundation PUBLIC ${PCRE_LIBRARY} ZLIB::ZLIB)
target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED)
endif(POCO_UNBUNDLED)

target_include_directories(Foundation
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${PCRE_INCLUDE_DIRS}>
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
23 changes: 10 additions & 13 deletions ports/poco/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pocoproject/poco
REF 8a127d6f16795d914cadc342d3f4f3b9b7999e3b #1.9.2
SHA512 282097ee2118ac55320ebdde05bb53ed27d68af49c201b0b26027706ef935ae08f8090abb8aab1cafe84c72520ea73b01263b439d32bd2d0bd55319b0634b168
REF 3fc3e5f5b8462f7666952b43381383a79b8b5d92 # poco-1.10.1-release
SHA512 4c53a24a2ab9c57f4bf94e233da65cbb144c101b7d8d422d7e687d6c90ce0b53cb7bcfae63205ff30cade0fd07319e44a32035c1b15637ea2958986efc4ad5df
HEAD_REF master
PATCHES
# Find pcre in debug
find_pcre.patch
# Add include path to public interface for static build
include_pcre.patch
# Fix embedded copy of pcre in static linking mode
Expand All @@ -15,9 +13,14 @@ vcpkg_from_github(
use-vcpkg-libharu.patch
# Add the support of arm64-windows
arm64_pcre.patch
fix_foundation_link.patch
fix_dependency.patch
)

file(REMOVE "${SOURCE_PATH}/Foundation/src/pcre.h")
file(REMOVE "${SOURCE_PATH}/cmake/V39/FindEXPAT.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/V313/FindSQLite3.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/FindPCRE.cmake")

# define Poco linkage type
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" POCO_STATIC)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" POCO_MT)
Expand Down Expand Up @@ -51,9 +54,7 @@ vcpkg_configure_cmake(
# Define linking feature
-DPOCO_STATIC=${POCO_STATIC}
-DPOCO_MT=${POCO_MT}
# Set to OFF|ON (default is OFF) to control build of POCO tests
-DENABLE_TESTS=OFF
# Set to OFF|ON (default is OFF) to control build of POCO samples
-DENABLE_SAMPLES=OFF
# Allow enabling and disabling components
# POCO_ENABLE_SQL_ODBC, POCO_ENABLE_SQL_MYSQL and POCO_ENABLE_SQL_POSTGRESQL are
Expand Down Expand Up @@ -83,7 +84,6 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()


# Copy additional include files not part of any libraries
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL")
file(COPY ${SOURCE_PATH}/Data/include DESTINATION ${CURRENT_PACKAGES_DIR})
Expand All @@ -102,7 +102,6 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/SQLite")
file(COPY ${SOURCE_PATH}/Data/SQLite/include DESTINATION ${CURRENT_PACKAGES_DIR})
endif()


# Move apps to the tools folder
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/cpspc.exe")
Expand Down Expand Up @@ -143,10 +142,8 @@ elseif(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/Poco")
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Poco)
endif()

# remove unused files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# copy license
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
53 changes: 27 additions & 26 deletions ports/poco/static_pcre.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt
index 0b8f7bc..c362890 100644
--- a/Foundation/CMakeLists.txt
+++ b/Foundation/CMakeLists.txt
@@ -53,6 +53,21 @@ if (POCO_UNBUNDLED)
include_directories(${ZLIB_INCLUDE_DIRS})

add_definitions(-DPOCO_UNBUNDLED)
+ add_definitions(
+ -D_pcre_utf8_table1=_poco_pcre_utf8_table1
+ -D_pcre_utf8_table1_size=_poco_pcre_utf8_table1_size
+ -D_pcre_utf8_table2=_poco_pcre_utf8_table2
+ -D_pcre_utf8_table3=_poco_pcre_utf8_table3
+ -D_pcre_utf8_table4=_poco_pcre_utf8_table4
+ -D_pcre_utt_names=_poco_pcre_utt_names
+ -D_pcre_utt=_poco_pcre_utt
+ -D_pcre_utt_size=_poco_pcre_utt_size
+ -D_pcre_OP_lengths=_poco_pcre_OP_lengths
+ -D_pcre_hspace_list=_poco_pcre_hspace_list
+ -D_pcre_vspace_list=_poco_pcre_vspace_list
+ -D_pcre_ucp_gentype=_poco_pcre_ucp_gentype
+ -D_pcre_ucp_gbtable=_poco_pcre_ucp_gbtable
+ )

else()
# pcre
diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt
index f7aca2b..6a3c120 100644
--- a/Foundation/CMakeLists.txt
+++ b/Foundation/CMakeLists.txt
@@ -103,6 +103,22 @@ set_target_properties(Foundation
if(POCO_UNBUNDLED)
target_link_libraries(Foundation PUBLIC ${PCRE_LIBRARY} ZLIB::ZLIB)
target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED)
+ add_definitions(
+ -D_pcre_utf8_table1=_poco_pcre_utf8_table1
+ -D_pcre_utf8_table1_size=_poco_pcre_utf8_table1_size
+ -D_pcre_utf8_table2=_poco_pcre_utf8_table2
+ -D_pcre_utf8_table3=_poco_pcre_utf8_table3
+ -D_pcre_utf8_table4=_poco_pcre_utf8_table4
+ -D_pcre_utt_names=_poco_pcre_utt_names
+ -D_pcre_utt=_poco_pcre_utt
+ -D_pcre_utt_size=_poco_pcre_utt_size
+ -D_pcre_OP_lengths=_poco_pcre_OP_lengths
+ -D_pcre_hspace_list=_poco_pcre_hspace_list
+ -D_pcre_vspace_list=_poco_pcre_vspace_list
+ -D_pcre_ucp_gentype=_poco_pcre_ucp_gentype
+ -D_pcre_ucp_gbtable=_poco_pcre_ucp_gbtable
+ )
+
endif(POCO_UNBUNDLED)

target_include_directories(Foundation
36 changes: 18 additions & 18 deletions ports/poco/use-vcpkg-libharu.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f8a2a6..1ffd0a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -195,8 +195,11 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS)
add_subdirectory(Redis)
list(APPEND Poco_COMPONENTS "Redis")
endif()
-if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF)
-add_subdirectory(PDF)
+if(ENABLE_PDF)
+include(SelectLibraryConfigurations)
+find_library(PocoPDF_LIBRARY_RELEASE NAMES libhpdf)
+find_library(PocoPDF_LIBRARY_DEBUG NAMES libhpdfd)
+select_library_configurations(PocoPDF)
list(APPEND Poco_COMPONENTS "PDF")
endif()

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b664afd..2174556 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -327,8 +327,11 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS)
list(APPEND Poco_COMPONENTS "Redis")
endif()
-if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF)
- add_subdirectory(PDF)
+if(ENABLE_PDF)
+ include(SelectLibraryConfigurations)
+ find_library(PocoPDF_LIBRARY_RELEASE NAMES libhpdf)
+ find_library(PocoPDF_LIBRARY_DEBUG NAMES libhpdfd)
+ select_library_configurations(PocoPDF)
list(APPEND Poco_COMPONENTS "PDF")
endif()