2021-06-11 23:48:00 +08:00
|
|
|
set (EX_VERSION 2.4.1)
|
|
|
|
|
2017-08-23 22:07:57 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libexpat/libexpat
|
2021-06-11 23:48:00 +08:00
|
|
|
REF a28238bdeebc087071777001245df1876a11f5ee #v2.4.1
|
|
|
|
SHA512 2c22f2dfab50644637a7777229849c91630ae8c50683df6ad6409d473690ce01b59ce9f98e66b0aeac8c650507f04edbb5d9738130c88b87bbc1adb7831c22a9
|
2020-08-17 23:33:44 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2020-08-28 13:20:06 +08:00
|
|
|
pkgconfig.patch
|
2020-08-17 23:33:44 +08:00
|
|
|
)
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2016-11-01 04:47:07 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
set(EXPAT_LINKAGE ON)
|
|
|
|
else()
|
|
|
|
set(EXPAT_LINKAGE OFF)
|
|
|
|
endif()
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
2017-08-23 22:07:57 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}/expat
|
|
|
|
PREFER_NINJA
|
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
|
|
|
|
-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
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2021-06-11 23:48:00 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/expat-${EX_VERSION})
|
2020-08-28 13:20:06 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2016-11-01 04:47:07 +08:00
|
|
|
|
2020-08-17 23:33:44 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2017-05-18 08:17:40 +08:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2020-08-17 23:33:44 +08:00
|
|
|
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/expat_external.h
|
|
|
|
"! 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()
|
|
|
|
|
|
|
|
#Handle copyright
|
2020-08-28 13:20:06 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/expat/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|