mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-26 13:21:39 +08:00
50fe35a3c3
https://github.com/microsoft/vcpkg/pull/24762#issuecomment-1139457412 indicates that building for C++17 will include extra catch2 formatters for types like std::string_view, so we should build catch2 with that version selected.
32 lines
1.1 KiB
CMake
32 lines
1.1 KiB
CMake
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO catchorg/Catch2
|
|
REF v3.0.1
|
|
SHA512 065094c19cdf98b40f96a390e887542f895495562a91cdc28d68ce03690866d846ec87d320405312a2b97eacaa5351d3e55f0012bb9de40073c8d4444d82b0a1
|
|
HEAD_REF devel
|
|
PATCHES
|
|
fix-install-path.patch
|
|
)
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
-DCATCH_INSTALL_DOCS=OFF
|
|
-DCMAKE_CXX_STANDARD=17
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Catch2)
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
# We remove these folders because they are empty and cause warnings on the library installation
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/catch2/benchmark/internal")
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/catch2/generators/internal")
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/include/catch.hpp" "#include <catch2/catch_all.hpp>")
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|