aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-08-28 05:23:02 +0800
committerCurtis J Bezault <curtbezault@gmail.com>2019-08-27 14:23:02 -0700
commit34c65d521d83112bec4fc12bcc5768204ebac974 (patch)
treea89f98645424ebc601d0e8a53e1a9582ca942520
parent8cf2067e571a070d6847c2bddb5d0f0a55934609 (diff)
downloadvcpkg-34c65d521d83112bec4fc12bcc5768204ebac974.tar.gz
vcpkg-34c65d521d83112bec4fc12bcc5768204ebac974.zip
[poco]Fix conflicts with libharu. (#7892)
-rw-r--r--ports/poco/CONTROL6
-rw-r--r--ports/poco/portfile.cmake11
-rw-r--r--ports/poco/unbundled_pdf.patch30
-rw-r--r--ports/poco/use-vcpkg-libharu.patch18
4 files changed, 30 insertions, 35 deletions
diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL
index e7e1656bb..9ea94f496 100644
--- a/ports/poco/CONTROL
+++ b/ports/poco/CONTROL
@@ -1,5 +1,5 @@
Source: poco
-Version: 1.9.2
+Version: 1.9.2-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
@@ -15,3 +15,7 @@ Description: MariaDB support for POCO
Feature: postgresql
Build-Depends: libpqxx
Description: PostgreSQL support for POCO
+
+Feature: pdf
+Build-Depends: libharu
+Description: Haru support for POCO
diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake
index 6d53a0048..518106030 100644
--- a/ports/poco/portfile.cmake
+++ b/ports/poco/portfile.cmake
@@ -13,8 +13,8 @@ vcpkg_from_github(
include_pcre.patch
# Fix embedded copy of pcre in static linking mode
static_pcre.patch
- # Fix source path of PDF
- unbundled_pdf.patch
+ # Use vcpkg installed libharu for feature pdf
+ use-vcpkg-libharu.patch
# Add the support of arm64-windows
arm64_pcre.patch
fix_foundation_link.patch
@@ -24,6 +24,10 @@ vcpkg_from_github(
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" POCO_STATIC)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" POCO_MT)
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ pdf ENABLE_PDF
+)
+
# MySQL / MariaDDB feature
if("mysql" IN_LIST FEATURES OR "mariadb" IN_LIST FEATURES)
if("mysql" IN_LIST FEATURES)
@@ -43,7 +47,7 @@ endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
#PREFER_NINJA
- OPTIONS
+ OPTIONS ${FEATURE_OPTIONS}
# Set to OFF|ON (default is OFF) to control linking dependencies as external
-DPOCO_UNBUNDLED=ON
# Define linking feature
@@ -63,7 +67,6 @@ vcpkg_configure_cmake(
-DENABLE_MONGODB=ON
# -DPOCO_ENABLE_SQL_SQLITE=ON # SQLITE are not supported.
-DENABLE_REDIS=ON
- -DENABLE_PDF=ON
-DENABLE_UTIL=ON
-DENABLE_NET=ON
-DENABLE_SEVENZIP=ON
diff --git a/ports/poco/unbundled_pdf.patch b/ports/poco/unbundled_pdf.patch
deleted file mode 100644
index e7f88f035..000000000
--- a/ports/poco/unbundled_pdf.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/PDF/CMakeLists.txt b/PDF/CMakeLists.txt
-index 3e44906..ae8fe6e 100644
---- a/PDF/CMakeLists.txt
-+++ b/PDF/CMakeLists.txt
-@@ -97,6 +97,8 @@ POCO_SOURCES(SRCS hpdf
-
- # TODO: Currently only bundled is supported, in future this should also be possible
- # with an unbundled version of libpng
-+find_package(PNG REQUIRED)
-+if (0)
- POCO_SOURCES( SRCS libpng
- src/png.c
- src/pngerror.c
-@@ -117,6 +119,7 @@ POCO_SOURCES( SRCS libpng
- src/pngwtran.c
- src/pngwutil.c
- )
-+endif(0)
-
- # Version Resource
- if(MSVC AND NOT POCO_STATIC)
-@@ -136,7 +139,7 @@ set_target_properties( "${LIBNAME}"
- DEFINE_SYMBOL PDF_EXPORTS
- )
-
--target_link_libraries( "${LIBNAME}" ${SYSLIBS} XML Util Foundation )
-+target_link_libraries( "${LIBNAME}" ${SYSLIBS} XML Util Foundation ${PNG_LIBRARIES})
- target_include_directories( "${LIBNAME}"
- PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
diff --git a/ports/poco/use-vcpkg-libharu.patch b/ports/poco/use-vcpkg-libharu.patch
new file mode 100644
index 000000000..e43b3c9cd
--- /dev/null
+++ b/ports/poco/use-vcpkg-libharu.patch
@@ -0,0 +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()
+