mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-26 13:21:39 +08:00
40 lines
1.4 KiB
CMake
40 lines
1.4 KiB
CMake
include(vcpkg_common_functions)
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO libexpat/libexpat
|
|
REF R_2_2_4
|
|
SHA512 64f9deb2f75be70450a60a408ab867d1df800022e29000a31a801d85421178b400ebbf817864d1592ce998ada1012fa25fd896e5f25c6b314851ae62d94b45dc
|
|
HEAD_REF master)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
set(EXPAT_LINKAGE ON)
|
|
else()
|
|
set(EXPAT_LINKAGE OFF)
|
|
endif()
|
|
|
|
vcpkg_configure_cmake(
|
|
SOURCE_PATH ${SOURCE_PATH}/expat
|
|
PREFER_NINJA
|
|
OPTIONS
|
|
-DBUILD_examples=OFF
|
|
-DBUILD_tests=OFF
|
|
-DBUILD_tools=OFF
|
|
-DBUILD_shared=${EXPAT_LINKAGE}
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
|
|
file(INSTALL ${SOURCE_PATH}/expat/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat RENAME copyright)
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
# CMake's FindExpat currently doesn't look for expatd.lib
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/expatd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/expat.lib)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/expat_external.h EXPAT_EXTERNAL_H)
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
string(REPLACE "!defined(XML_STATIC)" "/* vcpkg static build !defined(XML_STATIC) */ 0" EXPAT_EXTERNAL_H "${EXPAT_EXTERNAL_H}")
|
|
endif()
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/expat_external.h "${EXPAT_EXTERNAL_H}")
|