2022-10-06 07:03:23 +08:00
|
|
|
file(READ ${CMAKE_CURRENT_LIST_DIR}/vcpkg.json vcpkg_json)
|
|
|
|
string(JSON VERSION GET "${vcpkg_json}" "version")
|
2021-06-11 23:48:00 +08:00
|
|
|
|
2017-08-23 22:07:57 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libexpat/libexpat
|
2022-10-06 07:03:23 +08:00
|
|
|
REF R_2_4_9
|
|
|
|
SHA512 6bf92516ce2642b2cdcbc586aaac0f706f125394fa428670f9b8b042a1f393e3b9dda1a24e58e6c8ad8b4ff3303cb5a8700628c6c04a881a06251c08be3759d3
|
2020-08-17 23:33:44 +08:00
|
|
|
HEAD_REF master
|
2022-10-06 07:03:23 +08:00
|
|
|
PATCHES
|
|
|
|
"pkgconfig_fix.patch" # https://github.com/libexpat/libexpat/pull/656
|
2022-10-09 12:13:50 +08:00
|
|
|
"mingw_static_fix.patch" # https://github.com/libexpat/libexpat/pull/658
|
2020-08-17 23:33:44 +08:00
|
|
|
)
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2022-04-13 01:38:05 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" EXPAT_LINKAGE)
|
2016-11-01 04:47:07 +08:00
|
|
|
|
2022-04-02 06:57:36 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}/expat"
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
2020-08-17 23:33:44 +08:00
|
|
|
-DEXPAT_BUILD_EXAMPLES=OFF
|
|
|
|
-DEXPAT_BUILD_TESTS=OFF
|
|
|
|
-DEXPAT_BUILD_TOOLS=OFF
|
2022-04-13 01:38:05 +08:00
|
|
|
-DEXPAT_BUILD_DOCS=OFF
|
2020-08-17 23:33:44 +08:00
|
|
|
-DEXPAT_SHARED_LIBS=${EXPAT_LINKAGE}
|
2021-06-11 23:48:00 +08:00
|
|
|
-DEXPAT_BUILD_PKGCONFIG=ON
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
2022-04-02 06:57:36 +08:00
|
|
|
vcpkg_cmake_install()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2022-10-06 07:03:23 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/expat-${VERSION}")
|
2020-08-28 13:20:06 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2016-11-01 04:47:07 +08:00
|
|
|
|
2022-04-02 06:57:36 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2022-04-13 01:38:05 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|
2017-05-18 08:17:40 +08:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2022-04-13 01:38:05 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/expat_external.h"
|
2020-08-17 23:33:44 +08:00
|
|
|
"! defined(XML_STATIC)"
|
|
|
|
"/* vcpkg static build ! defined(XML_STATIC) */ 0"
|
|
|
|
)
|
2017-05-18 08:17:40 +08:00
|
|
|
endif()
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2020-08-17 23:33:44 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-04-02 06:57:36 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-04-13 01:38:05 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/expat/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|