vcpkg/ports/expat/portfile.cmake

44 lines
1.6 KiB
CMake
Raw Normal View History

string(REPLACE "." "_" REF "R_${VERSION}")
2017-08-23 22:07:57 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libexpat/libexpat
REF "${REF}"
SHA512 6a6c5b0f6a1b2c70715701aeab688e476943704c492a0f2f8afd7fea84615a8d9569eb2b699912676058eff6a7bbdd78b48110ed67ab0250a3d41fe8f128f4e1
HEAD_REF master
)
2016-09-19 11:50:08 +08:00
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" EXPAT_LINKAGE)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" EXPAT_CRT_LINKAGE)
2016-11-01 04:47:07 +08:00
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/expat"
2016-09-19 11:50:08 +08:00
OPTIONS
-DEXPAT_BUILD_EXAMPLES=OFF
-DEXPAT_BUILD_TESTS=OFF
-DEXPAT_BUILD_TOOLS=OFF
-DEXPAT_BUILD_DOCS=OFF
-DEXPAT_SHARED_LIBS=${EXPAT_LINKAGE}
-DEXPAT_MSVC_STATIC_CRT=${EXPAT_CRT_LINKAGE}
-DEXPAT_BUILD_PKGCONFIG=ON
2024-03-12 04:15:13 +08:00
MAYBE_UNUSED_VARIABLES
EXPAT_MSVC_STATIC_CRT
2016-09-19 11:50:08 +08:00
)
vcpkg_cmake_install()
2024-03-12 04:15:13 +08:00
vcpkg_copy_pdbs()
2022-10-06 07:03:23 +08:00
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/expat-${VERSION}")
vcpkg_fixup_pkgconfig()
2016-11-01 04:47:07 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
2024-06-27 11:30:23 +08:00
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/expat_external.h" "defined(_MSC_EXTENSIONS)" "defined(_WIN32)")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
2024-03-12 04:15:13 +08:00
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/expat_external.h" "! defined(XML_STATIC)" "0")
endif()
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
2024-03-12 04:15:13 +08:00
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/expat/COPYING")