diff options
Diffstat (limited to 'externals/find-modules/FindCatch2.cmake')
| -rw-r--r-- | externals/find-modules/FindCatch2.cmake | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/externals/find-modules/FindCatch2.cmake b/externals/find-modules/FindCatch2.cmake deleted file mode 100644 index bded15951..000000000 --- a/externals/find-modules/FindCatch2.cmake +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2020 yuzu Emulator Project | ||
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | find_package(PkgConfig QUIET) | ||
| 5 | pkg_check_modules(PC_Catch2 QUIET Catch2) | ||
| 6 | |||
| 7 | find_path(Catch2_INCLUDE_DIR | ||
| 8 | NAMES catch.hpp | ||
| 9 | PATHS ${PC_Catch2_INCLUDE_DIRS} ${CONAN_CATCH2_ROOT} | ||
| 10 | PATH_SUFFIXES catch2 | ||
| 11 | ) | ||
| 12 | |||
| 13 | if(Catch2_INCLUDE_DIR) | ||
| 14 | file(STRINGS "${Catch2_INCLUDE_DIR}/catch.hpp" _Catch2_version_lines | ||
| 15 | REGEX "#define[ \t]+CATCH_VERSION_(MAJOR|MINOR|PATCH)") | ||
| 16 | string(REGEX REPLACE ".*CATCH_VERSION_MAJOR +\([0-9]+\).*" "\\1" _Catch2_version_major "${_Catch2_version_lines}") | ||
| 17 | string(REGEX REPLACE ".*CATCH_VERSION_MINOR +\([0-9]+\).*" "\\1" _Catch2_version_minor "${_Catch2_version_lines}") | ||
| 18 | string(REGEX REPLACE ".*CATCH_VERSION_PATCH +\([0-9]+\).*" "\\1" _Catch2_version_patch "${_Catch2_version_lines}") | ||
| 19 | set(Catch2_VERSION "${_Catch2_version_major}.${_Catch2_version_minor}.${_Catch2_version_patch}") | ||
| 20 | unset(_Catch2_version_major) | ||
| 21 | unset(_Catch2_version_minor) | ||
| 22 | unset(_Catch2_version_patch) | ||
| 23 | unset(_Catch2_version_lines) | ||
| 24 | endif() | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | find_package_handle_standard_args(Catch2 | ||
| 28 | FOUND_VAR Catch2_FOUND | ||
| 29 | REQUIRED_VARS | ||
| 30 | Catch2_INCLUDE_DIR | ||
| 31 | Catch2_VERSION | ||
| 32 | VERSION_VAR Catch2_VERSION | ||
| 33 | ) | ||
| 34 | |||
| 35 | if(Catch2_FOUND) | ||
| 36 | set(Catch2_INCLUDE_DIRS ${Catch2_INCLUDE_DIR}) | ||
| 37 | set(Catch2_DEFINITIONS ${PC_Catch2_CFLAGS_OTHER}) | ||
| 38 | endif() | ||
| 39 | |||
| 40 | if(Catch2_FOUND AND NOT TARGET Catch2::Catch2) | ||
| 41 | add_library(Catch2::Catch2 UNKNOWN IMPORTED) | ||
| 42 | set_target_properties(Catch2::Catch2 PROPERTIES | ||
| 43 | IMPORTED_LOCATION "${Catch2_LIBRARY}" | ||
| 44 | INTERFACE_COMPILE_OPTIONS "${PC_Catch2_CFLAGS_OTHER}" | ||
| 45 | INTERFACE_INCLUDE_DIRECTORIES "${Catch2_INCLUDE_DIR}" | ||
| 46 | ) | ||
| 47 | endif() | ||
| 48 | |||
| 49 | mark_as_advanced( | ||
| 50 | Catch2_INCLUDE_DIR | ||
| 51 | ) | ||