[catch2] Use upstream github repo, which also generates cmake config targets.

This commit is contained in:
Robert Schumacher 2018-03-22 23:03:28 -07:00
parent b06e3f3c95
commit b00aa49657
2 changed files with 25 additions and 13 deletions

View File

@ -1,4 +1,4 @@
Source: catch2
Version: 2.2.1
Version: 2.2.1-1
Description: A modern, header-only test framework for unit testing.
Issues, PRs and changelogs can be found at https://github.com/catchorg/Catch2

View File

@ -1,18 +1,30 @@
include(vcpkg_common_functions)
set(CATCH_VERSION v2.2.1)
vcpkg_download_distfile(HEADER
URLS "https://github.com/catchorg/Catch2/releases/download/${CATCH_VERSION}/catch.hpp"
FILENAME "catchorg-catch2-${CATCH_VERSION}.hpp"
SHA512 89f707e667fabf1cc2be43b2ccf046a59007c68b8e4b37dde6799a960e57a9cdd1542289b83631ee6e450e22bf46cba477308ec872c1d0261c3bd4c218ab76fc
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO catchorg/Catch2
REF v2.2.1
SHA512 48d3a0384dcd19fe622c4fda51639be36c904aaff77f5857615010c57e69d8e9f1deb2156e3e4882a592fe260d2bae0efa3cd02c2a2cabe07d9f9db09051a6b0
HEAD_REF master
)
vcpkg_download_distfile(LICENSE
URLS "https://raw.githubusercontent.com/catchorg/Catch2/${CATCH_VERSION}/LICENSE.txt"
FILENAME "catchorg-catch2-LICENSE-${CATCH_VERSION}.txt"
SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_TESTING=OFF
-DCATCH_BUILD_EXAMPLES=OFF
)
file(INSTALL ${HEADER} DESTINATION ${CURRENT_PACKAGES_DIR}/include RENAME catch.hpp)
file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/catch2 RENAME copyright)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Catch2 TARGET_PATH share/catch2)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib)
if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/catch/catch.hpp)
message(FATAL_ERROR "Main includes have moved. Please update the forwarder.")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/catch.hpp "#include <catch/catch.hpp>")
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/catch2 RENAME copyright)