From 4f5169c69b5505a503e0885b42eef8dfd6c044ef Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Mon, 16 Nov 2020 00:36:46 -0800 Subject: [PATCH 1/2] [poco] Fix dependency and cmake config issue --- ports/poco/CONTROL | 2 +- ports/poco/fix_cmake_config.patch | 39 +++++++++++++++++++++++++++++++ ports/poco/fix_dependency.patch | 2 +- ports/poco/portfile.cmake | 1 + 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 ports/poco/fix_cmake_config.patch diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 6c4f1279ad11b5..275cc58f39a34e 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,6 +1,6 @@ Source: poco Version: 1.10.1 -Port-Version: 1 +Port-Version: 2 Build-Depends: expat, pcre, zlib 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 diff --git a/ports/poco/fix_cmake_config.patch b/ports/poco/fix_cmake_config.patch new file mode 100644 index 00000000000000..ca092dae3ae6c1 --- /dev/null +++ b/ports/poco/fix_cmake_config.patch @@ -0,0 +1,39 @@ +diff --git a/Foundation/cmake/PocoFoundationConfig.cmake b/Foundation/cmake/PocoFoundationConfig.cmake +index 46c2d3f..af2e78c 100644 +--- a/Foundation/cmake/PocoFoundationConfig.cmake ++++ b/Foundation/cmake/PocoFoundationConfig.cmake +@@ -2,7 +2,7 @@ if(@POCO_UNBUNDLED@) + include(CMakeFindDependencyMacro) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + find_dependency(ZLIB REQUIRED) +- find_dependency(PCRE REQUIRED) ++ find_dependency(unofficial-pcre REQUIRED) + endif() + + include("${CMAKE_CURRENT_LIST_DIR}/PocoFoundationTargets.cmake") +diff --git a/XML/cmake/PocoXMLConfig.cmake b/XML/cmake/PocoXMLConfig.cmake +index ef58207..4ed94ec 100644 +--- a/XML/cmake/PocoXMLConfig.cmake ++++ b/XML/cmake/PocoXMLConfig.cmake +@@ -4,7 +4,7 @@ if(@POCO_UNBUNDLED@) + if(CMAKE_VERSION VERSION_LESS "3.10") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/V39") + endif() +- find_dependency(EXPAT REQUIRED) ++ find_dependency(expat CONFIG REQUIRED) + endif() + + include("${CMAKE_CURRENT_LIST_DIR}/PocoXMLTargets.cmake") +diff --git a/cmake/PocoConfig.cmake.in b/cmake/PocoConfig.cmake.in +index 0687fe4..936edf4 100644 +--- a/cmake/PocoConfig.cmake.in ++++ b/cmake/PocoConfig.cmake.in +@@ -30,7 +30,7 @@ set(_Poco_NOTFOUND_MESSAGE) + + # Let components find each other, but don't overwrite CMAKE_PREFIX_PATH + set(_Poco_CMAKE_PREFIX_PATH_old ${CMAKE_PREFIX_PATH}) +-set(CMAKE_PREFIX_PATH ${_Poco_install_prefix}) ++set(CMAKE_PREFIX_PATH ${_Poco_install_prefix} ${CMAKE_PREFIX_PATH}) + + foreach(module ${Poco_FIND_COMPONENTS}) + find_package(Poco${module} diff --git a/ports/poco/fix_dependency.patch b/ports/poco/fix_dependency.patch index 4512ffce43ec9a..c732d7496920da 100644 --- a/ports/poco/fix_dependency.patch +++ b/ports/poco/fix_dependency.patch @@ -174,7 +174,7 @@ index 173eacd..9a375cd 100644 +find_dependency(ZLIB REQUIRED) +find_dependency(unofficial-pcre REQUIRED) +if(Poco_FIND_REQUIRED_XML) -+ find_dependency(EXPAT REQUIRED) ++ find_dependency(expat CONFIG REQUIRED) +endif() + set(_Poco_FIND_PARTS_REQUIRED) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 27187cf086f873..6b5d6a9730beca 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( # Add the support of arm64-windows arm64_pcre.patch fix_dependency.patch + fix_cmake_config.patch ) file(REMOVE "${SOURCE_PATH}/Foundation/src/pcre.h") From efa1a4c2d73c540dc2e51b93f5e6db53d66de92c Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Mon, 16 Nov 2020 18:25:48 -0800 Subject: [PATCH 2/2] Merge the patches --- ports/poco/fix_cmake_config.patch | 39 --- ports/poco/fix_dependency.patch | 399 ++++++++++++++++-------------- ports/poco/portfile.cmake | 1 - 3 files changed, 217 insertions(+), 222 deletions(-) delete mode 100644 ports/poco/fix_cmake_config.patch diff --git a/ports/poco/fix_cmake_config.patch b/ports/poco/fix_cmake_config.patch deleted file mode 100644 index ca092dae3ae6c1..00000000000000 --- a/ports/poco/fix_cmake_config.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/Foundation/cmake/PocoFoundationConfig.cmake b/Foundation/cmake/PocoFoundationConfig.cmake -index 46c2d3f..af2e78c 100644 ---- a/Foundation/cmake/PocoFoundationConfig.cmake -+++ b/Foundation/cmake/PocoFoundationConfig.cmake -@@ -2,7 +2,7 @@ if(@POCO_UNBUNDLED@) - include(CMakeFindDependencyMacro) - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") - find_dependency(ZLIB REQUIRED) -- find_dependency(PCRE REQUIRED) -+ find_dependency(unofficial-pcre REQUIRED) - endif() - - include("${CMAKE_CURRENT_LIST_DIR}/PocoFoundationTargets.cmake") -diff --git a/XML/cmake/PocoXMLConfig.cmake b/XML/cmake/PocoXMLConfig.cmake -index ef58207..4ed94ec 100644 ---- a/XML/cmake/PocoXMLConfig.cmake -+++ b/XML/cmake/PocoXMLConfig.cmake -@@ -4,7 +4,7 @@ if(@POCO_UNBUNDLED@) - if(CMAKE_VERSION VERSION_LESS "3.10") - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/V39") - endif() -- find_dependency(EXPAT REQUIRED) -+ find_dependency(expat CONFIG REQUIRED) - endif() - - include("${CMAKE_CURRENT_LIST_DIR}/PocoXMLTargets.cmake") -diff --git a/cmake/PocoConfig.cmake.in b/cmake/PocoConfig.cmake.in -index 0687fe4..936edf4 100644 ---- a/cmake/PocoConfig.cmake.in -+++ b/cmake/PocoConfig.cmake.in -@@ -30,7 +30,7 @@ set(_Poco_NOTFOUND_MESSAGE) - - # Let components find each other, but don't overwrite CMAKE_PREFIX_PATH - set(_Poco_CMAKE_PREFIX_PATH_old ${CMAKE_PREFIX_PATH}) --set(CMAKE_PREFIX_PATH ${_Poco_install_prefix}) -+set(CMAKE_PREFIX_PATH ${_Poco_install_prefix} ${CMAKE_PREFIX_PATH}) - - foreach(module ${Poco_FIND_COMPONENTS}) - find_package(Poco${module} diff --git a/ports/poco/fix_dependency.patch b/ports/poco/fix_dependency.patch index c732d7496920da..48c0c5bec446a1 100644 --- a/ports/poco/fix_dependency.patch +++ b/ports/poco/fix_dependency.patch @@ -1,182 +1,217 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b664afd..0f72521 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -82,8 +82,6 @@ option(FORCE_OPENSSL "Force usage of OpenSSL even under windows" OFF) - - if(ENABLE_CRYPTO OR ENABLE_NETSSL OR ENABLE_JWT) - find_package(OpenSSL REQUIRED) --else() -- find_package(OpenSSL) - endif() - - if(OPENSSL_FOUND) -@@ -113,24 +111,18 @@ else() - option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF) - endif() - --if(ENABLE_DATA_MYSQL) -- find_package(MySQL REQUIRED) --else() -- find_package(MySQL) --endif() -+option(ENABLE_DATA "Enable Data" OFF) -+option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF) - --if(MYSQL_FOUND) -- option(ENABLE_DATA "Enable Data" ON) -- option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" ON) --else() -- option(ENABLE_DATA "Enable Data" OFF) -- option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF) -+if(ENABLE_DATA_MYSQL) -+ find_package(libmysql) -+ if (NOT libmysql_FOUND) -+ find_package(unofficial-libmariadb CONFIG REQUIRED) -+ endif() - endif() - - if(ENABLE_DATA_POSTGRESQL) - find_package(PostgreSQL REQUIRED) --else() -- find_package(PostgreSQL) - endif() - - if(PostgreSQL_FOUND) -@@ -200,6 +192,9 @@ include(DefinePlatformSpecifc) - # Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file - set(Poco_COMPONENTS "") - -+# Do not declare the link library in the code! -+add_definitions(-DPOCO_NO_AUTOMATIC_LIBS) -+ - if(ENABLE_TESTS) - add_subdirectory(CppUnit) - set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE) -@@ -327,8 +322,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() - -@@ -457,15 +455,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/MySQL/CMakeLists.txt b/Data/MySQL/CMakeLists.txt -index f71b145..c3eaf9e 100644 ---- a/Data/MySQL/CMakeLists.txt -+++ b/Data/MySQL/CMakeLists.txt -@@ -21,7 +21,7 @@ set_target_properties(DataMySQL - DEFINE_SYMBOL MySQL_EXPORTS - ) - --target_link_libraries(DataMySQL PUBLIC Poco::Data MySQL::client) -+target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIBRARIES}) - target_include_directories(DataMySQL - PUBLIC - $ -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/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index 6f5100f..c9fa2e5 100644 ---- a/Foundation/CMakeLists.txt -+++ b/Foundation/CMakeLists.txt -@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) - # 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(PCRE REQUIRED) -+ find_package(unofficial-pcre CONFIG REQUIRED) - find_package(ZLIB REQUIRED) - - #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library -@@ -101,7 +101,7 @@ set_target_properties(Foundation - ) - - if(POCO_UNBUNDLED) -- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC unofficial::pcre::pcre ZLIB::ZLIB) - target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) - add_definitions( - -D_pcre_utf8_table1=_poco_pcre_utf8_table1 -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..9a375cd 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(unofficial-pcre REQUIRED) -+if(Poco_FIND_REQUIRED_XML) -+ find_dependency(expat CONFIG REQUIRED) -+endif() -+ - set(_Poco_FIND_PARTS_REQUIRED) - if (Poco_FIND_REQUIRED) - set(_Poco_FIND_PARTS_REQUIRED REQUIRED) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b664afd..e08b6c2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,8 +82,6 @@ option(FORCE_OPENSSL "Force usage of OpenSSL even under windows" OFF) + + if(ENABLE_CRYPTO OR ENABLE_NETSSL OR ENABLE_JWT) + find_package(OpenSSL REQUIRED) +-else() +- find_package(OpenSSL) + endif() + + if(OPENSSL_FOUND) +@@ -113,24 +111,18 @@ else() + option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF) + endif() + +-if(ENABLE_DATA_MYSQL) +- find_package(MySQL REQUIRED) +-else() +- find_package(MySQL) +-endif() ++option(ENABLE_DATA "Enable Data" OFF) ++option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF) + +-if(MYSQL_FOUND) +- option(ENABLE_DATA "Enable Data" ON) +- option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" ON) +-else() +- option(ENABLE_DATA "Enable Data" OFF) +- option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF) ++if(ENABLE_DATA_MYSQL) ++ find_package(libmysql) ++ if (NOT libmysql_FOUND) ++ find_package(unofficial-libmariadb CONFIG REQUIRED) ++ endif() + endif() + + if(ENABLE_DATA_POSTGRESQL) + find_package(PostgreSQL REQUIRED) +-else() +- find_package(PostgreSQL) + endif() + + if(PostgreSQL_FOUND) +@@ -200,6 +192,9 @@ include(DefinePlatformSpecifc) + # Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file + set(Poco_COMPONENTS "") + ++# Do not declare the link library in the code! ++add_definitions(-DPOCO_NO_AUTOMATIC_LIBS) ++ + if(ENABLE_TESTS) + add_subdirectory(CppUnit) + set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE) +@@ -327,8 +322,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() + +@@ -457,15 +455,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/MySQL/CMakeLists.txt b/Data/MySQL/CMakeLists.txt +index f71b145..7034974 100644 +--- a/Data/MySQL/CMakeLists.txt ++++ b/Data/MySQL/CMakeLists.txt +@@ -21,7 +21,7 @@ set_target_properties(DataMySQL + DEFINE_SYMBOL MySQL_EXPORTS + ) + +-target_link_libraries(DataMySQL PUBLIC Poco::Data MySQL::client) ++target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIBRARIES}) + target_include_directories(DataMySQL + PUBLIC + $ +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/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index 6f5100f..c9fa2e5 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) + # 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(PCRE REQUIRED) ++ find_package(unofficial-pcre CONFIG REQUIRED) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +@@ -101,7 +101,7 @@ set_target_properties(Foundation + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC unofficial::pcre::pcre ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + add_definitions( + -D_pcre_utf8_table1=_poco_pcre_utf8_table1 +diff --git a/Foundation/cmake/PocoFoundationConfig.cmake b/Foundation/cmake/PocoFoundationConfig.cmake +index 46c2d3f..af2e78c 100644 +--- a/Foundation/cmake/PocoFoundationConfig.cmake ++++ b/Foundation/cmake/PocoFoundationConfig.cmake +@@ -2,7 +2,7 @@ if(@POCO_UNBUNDLED@) + include(CMakeFindDependencyMacro) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + find_dependency(ZLIB REQUIRED) +- find_dependency(PCRE REQUIRED) ++ find_dependency(unofficial-pcre REQUIRED) + endif() + + include("${CMAKE_CURRENT_LIST_DIR}/PocoFoundationTargets.cmake") +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/XML/cmake/PocoXMLConfig.cmake b/XML/cmake/PocoXMLConfig.cmake +index ef58207..4ed94ec 100644 +--- a/XML/cmake/PocoXMLConfig.cmake ++++ b/XML/cmake/PocoXMLConfig.cmake +@@ -4,7 +4,7 @@ if(@POCO_UNBUNDLED@) + if(CMAKE_VERSION VERSION_LESS "3.10") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/V39") + endif() +- find_dependency(EXPAT REQUIRED) ++ find_dependency(expat CONFIG REQUIRED) + endif() + + include("${CMAKE_CURRENT_LIST_DIR}/PocoXMLTargets.cmake") +diff --git a/cmake/PocoConfig.cmake.in b/cmake/PocoConfig.cmake.in +index 173eacd..936edf4 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(unofficial-pcre REQUIRED) ++if(Poco_FIND_REQUIRED_XML) ++ find_dependency(expat CONFIG REQUIRED) ++endif() ++ + set(_Poco_FIND_PARTS_REQUIRED) + if (Poco_FIND_REQUIRED) + set(_Poco_FIND_PARTS_REQUIRED REQUIRED) +@@ -23,7 +30,7 @@ set(_Poco_NOTFOUND_MESSAGE) + + # Let components find each other, but don't overwrite CMAKE_PREFIX_PATH + set(_Poco_CMAKE_PREFIX_PATH_old ${CMAKE_PREFIX_PATH}) +-set(CMAKE_PREFIX_PATH ${_Poco_install_prefix}) ++set(CMAKE_PREFIX_PATH ${_Poco_install_prefix} ${CMAKE_PREFIX_PATH}) + + foreach(module ${Poco_FIND_COMPONENTS}) + find_package(Poco${module} diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 6b5d6a9730beca..27187cf086f873 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -12,7 +12,6 @@ vcpkg_from_github( # Add the support of arm64-windows arm64_pcre.patch fix_dependency.patch - fix_cmake_config.patch ) file(REMOVE "${SOURCE_PATH}/Foundation/src/pcre.h")