2022-12-19 14:49:37 -05:00
|
|
|
vcpkg_minimum_required(VERSION 2022-10-12)
|
|
|
|
string(REPLACE "." "_" REF "R_${VERSION}")
|
|
|
|
|
2017-08-23 16:07:57 +02:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libexpat/libexpat
|
2022-12-19 14:49:37 -05:00
|
|
|
REF "${REF}"
|
2022-10-31 23:47:44 +03:00
|
|
|
SHA512 779f0d0f3f2d8b33db0fd044864ab5ab1a40f20501f792fe90ad0d18de536c4765c3749f120e21fec11a0e6c89af1dc576d1fe261c871ca44a594f7b61fd1d9e
|
2020-08-17 23:33:44 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2022-04-12 19:38:05 +02:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" EXPAT_LINKAGE)
|
2022-11-24 02:12:44 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" EXPAT_CRT_LINKAGE)
|
2016-10-31 13:47:07 -07:00
|
|
|
|
2022-04-02 06:57:36 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}/expat"
|
2016-09-18 20:50:08 -07:00
|
|
|
OPTIONS
|
2020-08-17 23:33:44 +08:00
|
|
|
-DEXPAT_BUILD_EXAMPLES=OFF
|
|
|
|
-DEXPAT_BUILD_TESTS=OFF
|
|
|
|
-DEXPAT_BUILD_TOOLS=OFF
|
2022-04-12 19:38:05 +02:00
|
|
|
-DEXPAT_BUILD_DOCS=OFF
|
2020-08-17 23:33:44 +08:00
|
|
|
-DEXPAT_SHARED_LIBS=${EXPAT_LINKAGE}
|
2022-11-24 02:12:44 +08:00
|
|
|
-DEXPAT_MSVC_STATIC_CRT=${EXPAT_CRT_LINKAGE}
|
2021-06-11 23:48:00 +08:00
|
|
|
-DEXPAT_BUILD_PKGCONFIG=ON
|
2022-12-29 05:54:39 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES EXPAT_MSVC_STATIC_CRT
|
2016-09-18 20:50:08 -07:00
|
|
|
)
|
|
|
|
|
2022-04-02 06:57:36 +08:00
|
|
|
vcpkg_cmake_install()
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2022-10-06 02:03:23 +03:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/expat-${VERSION}")
|
2020-08-28 07:20:06 +02:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2016-10-31 13:47:07 -07: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-12 19:38:05 +02:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|
2017-05-17 18:17:40 -06:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2022-04-12 19:38:05 +02: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-17 18:17:40 -06:00
|
|
|
endif()
|
2018-09-11 13:11:51 -07: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-12 19:38:05 +02:00
|
|
|
file(INSTALL "${SOURCE_PATH}/expat/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|