2023-01-17 04:41:27 +08:00
|
|
|
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
2017-08-31 05:57:27 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO apache/xerces-c
|
2023-01-17 04:41:27 +08:00
|
|
|
REF "v${VERSION}"
|
2024-01-09 05:08:13 +08:00
|
|
|
SHA512 55bf16456408af7c5aa420a55b27555889fc102a24e86aecb918c165acc80bbc344420687061e020fe223ea04dd78bef929ceedc4b3e24727787f12b8d79b610
|
2020-01-30 03:52:41 +08:00
|
|
|
HEAD_REF master
|
2019-06-21 05:44:03 +08:00
|
|
|
PATCHES
|
2023-01-17 04:41:27 +08:00
|
|
|
dependencies.patch
|
2019-06-21 05:44:03 +08:00
|
|
|
disable-tests.patch
|
|
|
|
remove-dll-export-macro.patch
|
2017-01-27 08:27:52 +08:00
|
|
|
)
|
2023-01-17 04:41:27 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/FindICU.cmake")
|
2017-01-27 08:27:52 +08:00
|
|
|
|
2023-01-17 04:41:27 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS options
|
|
|
|
FEATURES
|
|
|
|
icu CMAKE_REQUIRE_FIND_PACKAGE_ICU
|
2023-07-06 02:48:02 +08:00
|
|
|
network network
|
2023-01-17 04:41:27 +08:00
|
|
|
INVERTED_FEATURES
|
|
|
|
icu CMAKE_DISABLE_FIND_PACKAGE_ICU
|
|
|
|
)
|
2018-12-13 04:47:57 +08:00
|
|
|
if("icu" IN_LIST FEATURES)
|
2023-02-03 10:49:20 +08:00
|
|
|
vcpkg_list(APPEND options -Dtranscoder=icu)
|
2023-01-17 04:41:27 +08:00
|
|
|
elseif(VCPKG_TARGET_IS_WINDOWS)
|
2023-02-03 10:49:20 +08:00
|
|
|
vcpkg_list(APPEND options -Dtranscoder=windows)
|
2023-01-17 04:41:27 +08:00
|
|
|
elseif(VCPKG_TARGET_IS_OSX)
|
2023-02-03 10:49:20 +08:00
|
|
|
vcpkg_list(APPEND options -Dtranscoder=macosunicodeconverter)
|
|
|
|
elseif(VCPKG_HOST_IS_OSX)
|
|
|
|
# Because of a bug in the transcoder selection script, the option
|
|
|
|
# "macosunicodeconverter" is always selected when building on macOS,
|
|
|
|
# regardless of the target platform. This breaks cross-compiling.
|
|
|
|
# As a workaround we force "iconv", which should at least work for iOS.
|
|
|
|
# Upstream fix: https://github.com/apache/xerces-c/pull/52
|
|
|
|
vcpkg_list(APPEND options -Dtranscoder=iconv)
|
2023-01-17 04:41:27 +08:00
|
|
|
else()
|
|
|
|
# xercesc chooses gnuiconv or iconv (cmake/XercesTranscoderSelection.cmake)
|
2018-12-13 04:47:57 +08:00
|
|
|
endif()
|
2023-01-17 04:41:27 +08:00
|
|
|
if("xmlch-wchar" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options -Dxmlch-type=wchar_t)
|
2019-03-09 02:18:01 +08:00
|
|
|
endif()
|
2018-12-13 04:47:57 +08:00
|
|
|
|
2023-01-17 04:41:27 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-11-02 10:47:20 +08:00
|
|
|
OPTIONS
|
|
|
|
-DDISABLE_TESTS=ON
|
|
|
|
-DDISABLE_DOC=ON
|
|
|
|
-DDISABLE_SAMPLES=ON
|
2019-08-13 05:42:45 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_CURL=ON
|
2023-01-17 04:41:27 +08:00
|
|
|
${options}
|
2023-07-06 02:48:02 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_CURL
|
2018-10-25 03:50:57 +08:00
|
|
|
)
|
|
|
|
|
2023-01-17 04:41:27 +08:00
|
|
|
vcpkg_cmake_install()
|
2018-10-25 03:50:57 +08:00
|
|
|
|
2020-01-22 02:03:57 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2023-01-17 04:41:27 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH cmake PACKAGE_NAME xercesc)
|
2017-01-27 08:43:22 +08:00
|
|
|
else()
|
2023-01-17 04:41:27 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/XercesC PACKAGE_NAME xercesc)
|
2017-01-27 08:43:22 +08:00
|
|
|
endif()
|
2017-01-27 08:27:52 +08:00
|
|
|
|
2023-01-17 04:41:27 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/xercesc/vcpkg-cmake-wrapper.cmake" @ONLY)
|
2022-03-16 06:04:53 +08:00
|
|
|
|
2018-10-25 03:50:57 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
)
|
2017-01-27 08:27:52 +08:00
|
|
|
|
2021-10-28 06:19:28 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2022-03-16 06:04:53 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
2023-01-17 04:41:27 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/xerces-c.pc" "-lxerces-c" "-lxerces-c_3")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/xerces-c.pc" "-lxerces-c" "-lxerces-c_3D")
|
2022-03-16 06:04:53 +08:00
|
|
|
endif()
|
2023-01-17 04:41:27 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
2023-02-10 02:59:04 +08:00
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|