2017-11-30 05:12:11 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO pocoproject/poco
|
2023-11-29 16:43:43 +08:00
|
|
|
REF "poco-1.12.5p1-release"
|
|
|
|
SHA512 9cf885f67d87b86d3d5337aa2a3247a5828e071bba04304dfb79f7e00d94cd245e5def5191400a5753eebe0611b7f120c470cb0e0ab9b120f1d8b5f202d7d3d7
|
2019-08-15 15:18:42 +08:00
|
|
|
HEAD_REF master
|
2016-11-16 15:10:40 +08:00
|
|
|
PATCHES
|
2019-03-09 08:18:22 +08:00
|
|
|
# Fix embedded copy of pcre in static linking mode
|
2022-11-01 04:13:06 +08:00
|
|
|
0001-static-pcre.patch
|
2019-04-24 05:01:23 +08:00
|
|
|
# Add the support of arm64-windows
|
2022-11-01 04:13:06 +08:00
|
|
|
0002-arm64-pcre.patch
|
|
|
|
0003-fix-dependency.patch
|
|
|
|
0004-fix-feature-sqlite3.patch
|
|
|
|
0005-fix-error-c3861.patch
|
|
|
|
0007-find-pcre2.patch
|
2016-11-16 15:10:40 +08:00
|
|
|
)
|
|
|
|
|
2022-11-01 04:13:06 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/Foundation/src/pcre2.h")
|
2020-10-27 14:11:26 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/V39/FindEXPAT.cmake")
|
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/V313/FindSQLite3.cmake")
|
2022-11-01 04:13:06 +08:00
|
|
|
# vcpkg's PCRE2 does not provide a FindPCRE2, and the bundled one seems to work fine
|
|
|
|
# file(REMOVE "${SOURCE_PATH}/cmake/FindPCRE2.cmake")
|
2021-08-03 07:57:14 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/XML/src/expat_config.h")
|
2020-11-14 05:35:03 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/FindMySQL.cmake")
|
2020-10-27 14:11:26 +08:00
|
|
|
|
2019-03-09 08:18:22 +08:00
|
|
|
# define Poco linkage type
|
2018-05-01 06:53:00 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" POCO_MT)
|
2017-11-01 16:27:12 +08:00
|
|
|
|
2019-08-28 05:23:02 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-08-03 07:57:14 +08:00
|
|
|
FEATURES
|
2023-03-04 03:50:00 +08:00
|
|
|
crypto ENABLE_CRYPTO
|
|
|
|
netssl ENABLE_NETSSL
|
2021-08-03 07:57:14 +08:00
|
|
|
pdf ENABLE_PDF
|
|
|
|
sqlite3 ENABLE_DATA_SQLITE
|
|
|
|
postgresql ENABLE_DATA_POSTGRESQL
|
2019-08-28 05:23:02 +08:00
|
|
|
)
|
|
|
|
|
2023-03-04 03:50:00 +08:00
|
|
|
# POCO_ENABLE_NETSSL_WIN:
|
|
|
|
# Use the unreleased NetSSL_Win module instead of (OpenSSL) NetSSL.
|
|
|
|
# This is a variable which can be set in the triplet file.
|
|
|
|
if(POCO_ENABLE_NETSSL_WIN)
|
|
|
|
string(REPLACE "ENABLE_NETSSL" "ENABLE_NETSSL_WIN" FEATURE_OPTIONS "${FEATURE_OPTIONS}")
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DENABLE_NETSSL:BOOL=OFF")
|
2022-11-11 00:23:12 +08:00
|
|
|
endif()
|
|
|
|
|
2020-11-14 05:35:03 +08:00
|
|
|
if ("mysql" IN_LIST FEATURES OR "mariadb" IN_LIST FEATURES)
|
|
|
|
set(POCO_USE_MYSQL ON)
|
|
|
|
else()
|
|
|
|
set(POCO_USE_MYSQL OFF)
|
2016-11-17 16:35:33 +08:00
|
|
|
endif()
|
|
|
|
|
2021-08-03 07:57:14 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-11-11 00:23:12 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-11-14 05:35:03 +08:00
|
|
|
# force to use dependencies as external
|
2019-03-09 08:18:22 +08:00
|
|
|
-DPOCO_UNBUNDLED=ON
|
|
|
|
# Define linking feature
|
2018-05-01 06:53:00 +08:00
|
|
|
-DPOCO_MT=${POCO_MT}
|
2019-08-15 15:18:42 +08:00
|
|
|
-DENABLE_TESTS=OFF
|
2019-03-09 08:18:22 +08:00
|
|
|
# Allow enabling and disabling components
|
2019-08-15 15:18:42 +08:00
|
|
|
-DENABLE_ENCODINGS=ON
|
|
|
|
-DENABLE_ENCODINGS_COMPILER=ON
|
|
|
|
-DENABLE_XML=ON
|
|
|
|
-DENABLE_JSON=ON
|
|
|
|
-DENABLE_MONGODB=ON
|
|
|
|
-DENABLE_REDIS=ON
|
|
|
|
-DENABLE_UTIL=ON
|
|
|
|
-DENABLE_NET=ON
|
|
|
|
-DENABLE_SEVENZIP=ON
|
|
|
|
-DENABLE_ZIP=ON
|
|
|
|
-DENABLE_CPPPARSER=ON
|
|
|
|
-DENABLE_POCODOC=ON
|
|
|
|
-DENABLE_PAGECOMPILER=ON
|
|
|
|
-DENABLE_PAGECOMPILER_FILE2PAGE=ON
|
2020-11-14 05:35:03 +08:00
|
|
|
-DPOCO_DISABLE_INTERNAL_OPENSSL=ON
|
|
|
|
-DENABLE_APACHECONNECTOR=OFF
|
|
|
|
-DENABLE_DATA_MYSQL=${POCO_USE_MYSQL}
|
2022-11-01 04:13:06 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES # these are only used when if(MSVC)
|
|
|
|
POCO_DISABLE_INTERNAL_OPENSSL
|
|
|
|
POCO_MT
|
2016-11-16 15:10:40 +08:00
|
|
|
)
|
|
|
|
|
2021-08-03 07:57:14 +08:00
|
|
|
vcpkg_cmake_install()
|
2016-11-16 15:10:40 +08:00
|
|
|
|
2020-11-14 05:35:03 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
# Move apps to the tools folder
|
2021-08-03 07:57:14 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES cpspc f2cpsp PocoDoc tec arc AUTO_CLEAN)
|
2020-11-14 05:35:03 +08:00
|
|
|
|
2022-11-01 04:13:06 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
|
|
|
|
2019-03-09 08:18:22 +08:00
|
|
|
# Copy additional include files not part of any libraries
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL")
|
2021-12-23 11:53:44 +08:00
|
|
|
file(COPY "${SOURCE_PATH}/Data/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
|
2019-03-09 08:18:22 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/MySQL")
|
2021-12-23 11:53:44 +08:00
|
|
|
file(COPY "${SOURCE_PATH}/Data/MySQL/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
|
2019-03-09 08:18:22 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/ODBC")
|
2021-12-23 11:53:44 +08:00
|
|
|
file(COPY "${SOURCE_PATH}/Data/ODBC/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
|
2019-03-09 08:18:22 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/PostgreSQL")
|
2021-12-23 11:53:44 +08:00
|
|
|
file(COPY "${SOURCE_PATH}/Data/PostgreSQL/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/libpq")
|
2019-03-09 08:18:22 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/SQLite")
|
2021-12-23 11:53:44 +08:00
|
|
|
file(COPY "${SOURCE_PATH}/Data/SQLite/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
|
2019-03-09 08:18:22 +08:00
|
|
|
endif()
|
|
|
|
|
2020-11-14 05:35:03 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2021-08-03 07:57:14 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
|
2020-11-14 05:35:03 +08:00
|
|
|
else()
|
2021-08-03 07:57:14 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Poco)
|
2019-03-09 08:18:22 +08:00
|
|
|
endif()
|
|
|
|
|
2021-08-03 07:57:14 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
|
2022-11-10 03:03:26 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2023-11-06 00:58:57 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|