From fd27d56ca417387e6468a096076b8c050fd04075 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Fri, 6 Mar 2020 03:22:04 -0800 Subject: [PATCH 1/9] [poco] Update to 1.10.1 --- ports/poco/CONTROL | 2 +- ports/poco/find_pcre.patch | 51 ++++++++++++++------------ ports/poco/fix_foundation_link.patch | 36 +++++++------------ ports/poco/include_pcre.patch | 32 ++++++++++------- ports/poco/portfile.cmake | 20 ++++------- ports/poco/static_pcre.patch | 53 ++++++++++++++-------------- ports/poco/use-vcpkg-libharu.patch | 36 +++++++++---------- 7 files changed, 113 insertions(+), 117 deletions(-) diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index be032c6de71cb7..a2e4d7a9386ede 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,5 +1,5 @@ Source: poco -Version: 1.9.2-2 +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 diff --git a/ports/poco/find_pcre.patch b/ports/poco/find_pcre.patch index 3b73ae4f121225..05ec535e5a3d35 100644 --- a/ports/poco/find_pcre.patch +++ b/ports/poco/find_pcre.patch @@ -1,22 +1,29 @@ -diff --git a/cmake/FindPCRE.cmake b/cmake/FindPCRE.cmake -index 41a99cb..b1acb32 100644 ---- a/cmake/FindPCRE.cmake -+++ b/cmake/FindPCRE.cmake -@@ -14,9 +14,15 @@ ENDIF (PCRE_INCLUDE_DIRS) - - FIND_PATH(PCRE_INCLUDE_DIR pcre.h) - --SET(PCRE_NAMES pcre) -+if (WIN32) -+include(SelectLibraryConfigurations) -+find_library(PCRE_LIBRARY_RELEASE NAMES pcre) -+find_library(PCRE_LIBRARY_DEBUG NAMES pcred) -+select_library_configurations(PCRE) -+else() -+SET(PCRE_NAMES pcred pcre) - FIND_LIBRARY(PCRE_LIBRARY NAMES ${PCRE_NAMES} ) -- -+endif() - # handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if - # all listed variables are TRUE - INCLUDE(FindPackageHandleStandardArgs) +diff --git a/cmake/FindPCRE.cmake b/cmake/FindPCRE.cmake +index c5bb73c..ab5ada7 100644 +--- a/cmake/FindPCRE.cmake ++++ b/cmake/FindPCRE.cmake +@@ -66,15 +66,15 @@ find_path(PCRE_INCLUDE_DIR + DOC "Specify the include directory containing pcre.h" + ) + +-find_library(PCRE_LIBRARY +- NAMES pcre +- HINTS +- ${PCRE_ROOT_DIR}/lib +- ${PCRE_ROOT_LIBRARY_DIRS} +- PATHS +- ${PC_PCRE_LIBRARY_DIRS} +- DOC "Specify the lib directory containing pcre" +-) ++if(WIN32) ++ include(SelectLibraryConfigurations) ++ find_library(PCRE_LIBRARY_RELEASE NAMES pcre) ++ find_library(PCRE_LIBRARY_DEBUG NAMES pcred) ++ select_library_configurations(PCRE) ++else() ++ SET(PCRE_NAMES pcred pcre) ++ find_library(PCRE_LIBRARY NAMES ${PCRE_NAMES}) ++endif() + + set(PCRE_VERSION ${PC_PCRE_VERSION}) + diff --git a/ports/poco/fix_foundation_link.patch b/ports/poco/fix_foundation_link.patch index c8830ed4f1df51..7fdf77e2bbbeda 100644 --- a/ports/poco/fix_foundation_link.patch +++ b/ports/poco/fix_foundation_link.patch @@ -1,24 +1,12 @@ -diff --git a/Foundation/src/Environment_WIN32.cpp b/Foundation/src/Environment_WIN32.cpp -index 62845fa..edcf6fe 100644 ---- a/Foundation/src/Environment_WIN32.cpp -+++ b/Foundation/src/Environment_WIN32.cpp -@@ -22,6 +22,7 @@ - #include - #include - -+#pragma comment(lib, "IPHLPAPI.lib") - - namespace Poco { - -diff --git a/Foundation/src/Environment_WINCE.cpp b/Foundation/src/Environment_WINCE.cpp -index afa59b6..c43767b 100644 ---- a/Foundation/src/Environment_WINCE.cpp -+++ b/Foundation/src/Environment_WINCE.cpp -@@ -23,6 +23,7 @@ - #include - #include - -+#pragma comment(lib, "IPHLPAPI.lib") - - namespace Poco { - +diff --git a/Foundation/src/Environment_WINCE.cpp b/Foundation/src/Environment_WINCE.cpp +index afa59b6..c43767b 100644 +--- a/Foundation/src/Environment_WINCE.cpp ++++ b/Foundation/src/Environment_WINCE.cpp +@@ -23,6 +23,7 @@ + #include + #include + ++#pragma comment(lib, "IPHLPAPI.lib") + + namespace Poco { + diff --git a/ports/poco/include_pcre.patch b/ports/poco/include_pcre.patch index 5db2372ea7e912..18b90e990e03cc 100644 --- a/ports/poco/include_pcre.patch +++ b/ports/poco/include_pcre.patch @@ -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 - $ -+ $ - $ - 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 + $ ++ $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src + ) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 27eddc98256726..7d39e66fbbc613 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - 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 @@ -17,7 +15,7 @@ vcpkg_from_github( use-vcpkg-libharu.patch # Add the support of arm64-windows arm64_pcre.patch - fix_foundation_link.patch + #fix_foundation_link.patch ) # define Poco linkage type @@ -104,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") @@ -119,8 +116,6 @@ else() file(RENAME ${CURRENT_PACKAGES_DIR}/bin/tec ${CURRENT_PACKAGES_DIR}/tools/tec) endif() - -# if (VCPKG_LIBRARY_LINKAGE STREQUAL static OR VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin @@ -141,18 +136,15 @@ else() ${CURRENT_PACKAGES_DIR}/debug/bin/tec.pdb) endif() -# if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake") vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) 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(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/poco/static_pcre.patch b/ports/poco/static_pcre.patch index a6dab02ced084c..7f2bd330f5eeb9 100644 --- a/ports/poco/static_pcre.patch +++ b/ports/poco/static_pcre.patch @@ -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 diff --git a/ports/poco/use-vcpkg-libharu.patch b/ports/poco/use-vcpkg-libharu.patch index e43b3c9cd7bcc7..c0b3dee7742dc8 100644 --- a/ports/poco/use-vcpkg-libharu.patch +++ b/ports/poco/use-vcpkg-libharu.patch @@ -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() + From cc37a6e2d593f188b669613c2966350eb9e0ae70 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Tue, 1 Sep 2020 02:40:16 -0700 Subject: [PATCH 2/9] Fix dependency pcre expat and sqlite3 --- ports/poco/find_pcre.patch | 17 ++++------ ports/poco/fix_expat_sqlite3.patch | 54 ++++++++++++++++++++++++++++++ ports/poco/portfile.cmake | 9 ++--- 3 files changed, 65 insertions(+), 15 deletions(-) create mode 100644 ports/poco/fix_expat_sqlite3.patch diff --git a/ports/poco/find_pcre.patch b/ports/poco/find_pcre.patch index 05ec535e5a3d35..406aefba6ac2c9 100644 --- a/ports/poco/find_pcre.patch +++ b/ports/poco/find_pcre.patch @@ -1,8 +1,8 @@ diff --git a/cmake/FindPCRE.cmake b/cmake/FindPCRE.cmake -index c5bb73c..ab5ada7 100644 +index c5bb73c..4a8f4ba 100644 --- a/cmake/FindPCRE.cmake +++ b/cmake/FindPCRE.cmake -@@ -66,15 +66,15 @@ find_path(PCRE_INCLUDE_DIR +@@ -66,15 +66,10 @@ find_path(PCRE_INCLUDE_DIR DOC "Specify the include directory containing pcre.h" ) @@ -15,15 +15,10 @@ index c5bb73c..ab5ada7 100644 - ${PC_PCRE_LIBRARY_DIRS} - DOC "Specify the lib directory containing pcre" -) -+if(WIN32) -+ include(SelectLibraryConfigurations) -+ find_library(PCRE_LIBRARY_RELEASE NAMES pcre) -+ find_library(PCRE_LIBRARY_DEBUG NAMES pcred) -+ select_library_configurations(PCRE) -+else() -+ SET(PCRE_NAMES pcred pcre) -+ find_library(PCRE_LIBRARY NAMES ${PCRE_NAMES}) -+endif() ++include(SelectLibraryConfigurations) ++find_library(PCRE_LIBRARY_RELEASE NAMES pcre) ++find_library(PCRE_LIBRARY_DEBUG NAMES pcred) ++select_library_configurations(PCRE) set(PCRE_VERSION ${PC_PCRE_VERSION}) diff --git a/ports/poco/fix_expat_sqlite3.patch b/ports/poco/fix_expat_sqlite3.patch new file mode 100644 index 00000000000000..423d76e67e1b13 --- /dev/null +++ b/ports/poco/fix_expat_sqlite3.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b664afd..453b716 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -460,10 +460,10 @@ install( + 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") ++ # 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") +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..aa85297 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 diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 6b9ead60389af9..1427eede7edb82 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -15,8 +15,13 @@ vcpkg_from_github( use-vcpkg-libharu.patch # Add the support of arm64-windows arm64_pcre.patch + fix_expat_sqlite3.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") + # define Poco linkage type string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" POCO_STATIC) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" POCO_MT) @@ -50,9 +55,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 @@ -82,7 +85,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}) @@ -142,7 +144,6 @@ elseif(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/Poco") endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() From 1403f584bdf30993876e94ad8770798fc6236bea Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Tue, 1 Sep 2020 19:02:35 -0700 Subject: [PATCH 3/9] fix typo issue --- ports/poco/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 1427eede7edb82..02200e8533c51c 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -19,8 +19,8 @@ vcpkg_from_github( ) 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/V39/FindEXPAT.cmake") +file(REMOVE "${SOURCE_PATH}/cmake/V313/FindSQLite3.cmake") # define Poco linkage type string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" POCO_STATIC) From 4e8ed4e69200fef89ccbe6bba6dbca7842e9a7dd Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Tue, 1 Sep 2020 22:52:25 -0700 Subject: [PATCH 4/9] Fix expat --- ports/poco/fix_expat_sqlite3.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/poco/fix_expat_sqlite3.patch b/ports/poco/fix_expat_sqlite3.patch index 423d76e67e1b13..531a2de382c7fd 100644 --- a/ports/poco/fix_expat_sqlite3.patch +++ b/ports/poco/fix_expat_sqlite3.patch @@ -40,7 +40,7 @@ index b52e2c5..0dcfae2 100644 POCO_UNBUNDLED SQLITE_THREADSAFE=1 diff --git a/XML/CMakeLists.txt b/XML/CMakeLists.txt -index 4fbf06f..aa85297 100644 +index 4fbf06f..793285a 100644 --- a/XML/CMakeLists.txt +++ b/XML/CMakeLists.txt @@ -20,7 +20,7 @@ endif() @@ -52,3 +52,12 @@ index 4fbf06f..aa85297 100644 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) From 00687743af34efa29e9b3c1f2bef9739a1877da7 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 2 Sep 2020 02:23:18 -0700 Subject: [PATCH 5/9] Add vcpkg-cmake-wrapper.cmake for pcre --- ports/pcre/CONTROL | 2 +- ports/pcre/portfile.cmake | 1 + ports/pcre/vcpkg-cmake-wrapper.cmake | 10 +++++ ports/poco/find_pcre.patch | 24 ----------- ...pat_sqlite3.patch => fix_dependency.patch} | 41 ++++++++++++++----- ports/poco/portfile.cmake | 5 +-- 6 files changed, 44 insertions(+), 39 deletions(-) create mode 100644 ports/pcre/vcpkg-cmake-wrapper.cmake delete mode 100644 ports/poco/find_pcre.patch rename ports/poco/{fix_expat_sqlite3.patch => fix_dependency.patch} (67%) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index cbd70b86927bb0..5f42aa89dc6df5 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -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 diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 6175b0bbb1f43c..fdc76b4ca44d54 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -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() diff --git a/ports/pcre/vcpkg-cmake-wrapper.cmake b/ports/pcre/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..7edef6b0095bb2 --- /dev/null +++ b/ports/pcre/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,10 @@ +include(SelectLibraryConfigurations) + +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 ${LIBUSB_LIBRARY}) \ No newline at end of file diff --git a/ports/poco/find_pcre.patch b/ports/poco/find_pcre.patch deleted file mode 100644 index 406aefba6ac2c9..00000000000000 --- a/ports/poco/find_pcre.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/cmake/FindPCRE.cmake b/cmake/FindPCRE.cmake -index c5bb73c..4a8f4ba 100644 ---- a/cmake/FindPCRE.cmake -+++ b/cmake/FindPCRE.cmake -@@ -66,15 +66,10 @@ find_path(PCRE_INCLUDE_DIR - DOC "Specify the include directory containing pcre.h" - ) - --find_library(PCRE_LIBRARY -- NAMES pcre -- HINTS -- ${PCRE_ROOT_DIR}/lib -- ${PCRE_ROOT_LIBRARY_DIRS} -- PATHS -- ${PC_PCRE_LIBRARY_DIRS} -- DOC "Specify the lib directory containing pcre" --) -+include(SelectLibraryConfigurations) -+find_library(PCRE_LIBRARY_RELEASE NAMES pcre) -+find_library(PCRE_LIBRARY_DEBUG NAMES pcred) -+select_library_configurations(PCRE) - - set(PCRE_VERSION ${PC_PCRE_VERSION}) - diff --git a/ports/poco/fix_expat_sqlite3.patch b/ports/poco/fix_dependency.patch similarity index 67% rename from ports/poco/fix_expat_sqlite3.patch rename to ports/poco/fix_dependency.patch index 531a2de382c7fd..df757758659441 100644 --- a/ports/poco/fix_expat_sqlite3.patch +++ b/ports/poco/fix_dependency.patch @@ -1,22 +1,23 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index b664afd..453b716 100644 +index b664afd..0d4670e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -460,10 +460,10 @@ install( - if(POCO_UNBUNDLED) - install(FILES cmake/FindPCRE.cmake - DESTINATION "${PocoConfigPackageLocation}") +@@ -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") -+ # install(FILES cmake/V39/FindEXPAT.cmake -+ # DESTINATION "${PocoConfigPackageLocation}/V39") -+ # install(FILES cmake/V313/FindSQLite3.cmake -+ # DESTINATION "${PocoConfigPackageLocation}/V313") - endif() - +-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 @@ -61,3 +62,21 @@ index 4fbf06f..793285a 100644 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) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 02200e8533c51c..5a25b98e2bc23e 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -5,8 +5,6 @@ vcpkg_from_github( 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 @@ -15,12 +13,13 @@ vcpkg_from_github( use-vcpkg-libharu.patch # Add the support of arm64-windows arm64_pcre.patch - fix_expat_sqlite3.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) From dfe6560828e2bfde7c7b52048a903d36be596014 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 2 Sep 2020 18:22:42 -0700 Subject: [PATCH 6/9] Fix typo issue --- ports/pcre/vcpkg-cmake-wrapper.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/pcre/vcpkg-cmake-wrapper.cmake b/ports/pcre/vcpkg-cmake-wrapper.cmake index 7edef6b0095bb2..ab8ba08c9bbf13 100644 --- a/ports/pcre/vcpkg-cmake-wrapper.cmake +++ b/ports/pcre/vcpkg-cmake-wrapper.cmake @@ -7,4 +7,4 @@ find_library(PCRE_LIBRARY_RELEASE NAMES pcre NAMES_PER_DIR PATH_SUFFIXES lib PAT select_library_configurations(PCRE) set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) -set(PCRE_LIBRARIES ${LIBUSB_LIBRARY}) \ No newline at end of file +set(PCRE_LIBRARIES ${PCRE_LIBRARY}) \ No newline at end of file From 9d4b2b0d4b3375446f839224a06d68779ea75d9c Mon Sep 17 00:00:00 2001 From: Phoebe <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 2 Sep 2020 23:20:50 -0700 Subject: [PATCH 7/9] Update ports/pcre/vcpkg-cmake-wrapper.cmake --- ports/pcre/vcpkg-cmake-wrapper.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/pcre/vcpkg-cmake-wrapper.cmake b/ports/pcre/vcpkg-cmake-wrapper.cmake index ab8ba08c9bbf13..0c96e441bfb88b 100644 --- a/ports/pcre/vcpkg-cmake-wrapper.cmake +++ b/ports/pcre/vcpkg-cmake-wrapper.cmake @@ -1,5 +1,7 @@ +include(FindPackageHandleStandardArgs) include(SelectLibraryConfigurations) + 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) @@ -7,4 +9,4 @@ find_library(PCRE_LIBRARY_RELEASE NAMES pcre NAMES_PER_DIR PATH_SUFFIXES lib PAT select_library_configurations(PCRE) set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) -set(PCRE_LIBRARIES ${PCRE_LIBRARY}) \ No newline at end of file +set(PCRE_LIBRARIES ${PCRE_LIBRARY}) From a53bdb6e6712ccedf7156f0394cdd07b02ab87e8 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 21 Oct 2020 01:30:42 -0700 Subject: [PATCH 8/9] Update the patch to use pcre export cmake targets --- ports/poco/fix_dependency.patch | 2 +- ports/poco/include_pcre.patch | 22 ++++++++++++---------- ports/poco/static_pcre.patch | 7 +++---- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ports/poco/fix_dependency.patch b/ports/poco/fix_dependency.patch index df757758659441..1521656e1d7127 100644 --- a/ports/poco/fix_dependency.patch +++ b/ports/poco/fix_dependency.patch @@ -72,7 +72,7 @@ index 173eacd..589fdb6 100644 +include(CMakeFindDependencyMacro) +find_dependency(ZLIB REQUIRED) -+find_dependency(PCRE REQUIRED) ++find_dependency(unofficial-pcre REQUIRED) +if(Poco_FIND_REQUIRED_XML) + find_dependency(EXPAT REQUIRED) +endif() diff --git a/ports/poco/include_pcre.patch b/ports/poco/include_pcre.patch index 18b90e990e03cc..c714c4a7e890a4 100644 --- a/ports/poco/include_pcre.patch +++ b/ports/poco/include_pcre.patch @@ -1,20 +1,22 @@ diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index 6b276be..0a3c63b 100644 +index 6b276be..f093991 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt -@@ -101,13 +101,14 @@ set_target_properties(Foundation +@@ -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 ${PCRE_LIBRARY} ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC unofficial::pcre::pcre ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif(POCO_UNBUNDLED) - target_include_directories(Foundation - PUBLIC - $ -+ $ - $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src - ) diff --git a/ports/poco/static_pcre.patch b/ports/poco/static_pcre.patch index 7f2bd330f5eeb9..2618bce1e3f423 100644 --- a/ports/poco/static_pcre.patch +++ b/ports/poco/static_pcre.patch @@ -1,10 +1,10 @@ diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index f7aca2b..6a3c120 100644 +index f093991..c9fa2e5 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt -@@ -103,6 +103,22 @@ set_target_properties(Foundation +@@ -103,6 +103,21 @@ set_target_properties(Foundation if(POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC ${PCRE_LIBRARY} 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 @@ -21,7 +21,6 @@ index f7aca2b..6a3c120 100644 + -D_pcre_ucp_gentype=_poco_pcre_ucp_gentype + -D_pcre_ucp_gbtable=_poco_pcre_ucp_gbtable + ) -+ endif(POCO_UNBUNDLED) target_include_directories(Foundation From 025b937af178b047a741393a0aba1157cb021a75 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 21 Oct 2020 01:34:06 -0700 Subject: [PATCH 9/9] Undo changes for pcre --- ports/pcre/CONTROL | 2 +- ports/pcre/portfile.cmake | 1 - ports/pcre/vcpkg-cmake-wrapper.cmake | 12 ------------ 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 ports/pcre/vcpkg-cmake-wrapper.cmake diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index 5f42aa89dc6df5..cbd70b86927bb0 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,5 +1,5 @@ Source: pcre Version: 8.44 -Port-Version: 8 +Port-Version: 7 Homepage: https://www.pcre.org/ Description: Perl Compatible Regular Expressions diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index fdc76b4ca44d54..6175b0bbb1f43c 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -121,7 +121,6 @@ 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() diff --git a/ports/pcre/vcpkg-cmake-wrapper.cmake b/ports/pcre/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 0c96e441bfb88b..00000000000000 --- a/ports/pcre/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,12 +0,0 @@ -include(FindPackageHandleStandardArgs) -include(SelectLibraryConfigurations) - - -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})