vcpkg/ports/expat/portfile.cmake
Frank 656e0afa0d
[expat]update to 2.4.8 (#22575)
* [expat]update to 2.4.3

* update version

* delete patch

* update version

* delete patch

* overwrite version

* update version 2.4.4

* update version

* delete git-tree

* update version to 2.4.7

* update version

* delete version-json

* update to 2.4.8

* update version
2022-04-01 15:57:36 -07:00

48 lines
1.4 KiB
CMake

set (EX_VERSION 2.4.8)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libexpat/libexpat
REF 3bab6c09bbe8bf42d84b81563ddbcf4cca4be838 #v2.4.8
SHA512 6bddf6514183b3bfa6bf869e63cf838cfe2912941ef04543bce00bee84a305f494368fb7cbd80404d06877a1d8da82de5ac2b44074b25e34aeaee7949d37e451
HEAD_REF master
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(EXPAT_LINKAGE ON)
else()
set(EXPAT_LINKAGE OFF)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/expat"
OPTIONS
-DEXPAT_BUILD_EXAMPLES=OFF
-DEXPAT_BUILD_TESTS=OFF
-DEXPAT_BUILD_TOOLS=OFF
-DEXPAT_SHARED_LIBS=${EXPAT_LINKAGE}
-DEXPAT_BUILD_PKGCONFIG=ON
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/expat-${EX_VERSION}")
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/expat_external.h
"! defined(XML_STATIC)"
"/* vcpkg static build ! defined(XML_STATIC) */ 0"
)
endif()
vcpkg_copy_pdbs()
#Handle copyright
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}")