diff options
author | James Rowe <jroweboy@gmail.com> | 2020-05-08 23:09:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 23:09:29 +0200 |
commit | bc30a591ba7252e0c16d9c1b3c75a7073735bcae (patch) | |
tree | 2e88ab16d60c7df3e665bcf7c75c24683cb07189 /externals/find-modules/FindCatch2.cmake | |
parent | Merge pull request #3885 from ReinUsesLisp/viewport-swizzles (diff) | |
download | yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.gz yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.bz2 yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.lz yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.xz yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.zst yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.zip |
Diffstat (limited to 'externals/find-modules/FindCatch2.cmake')
-rw-r--r-- | externals/find-modules/FindCatch2.cmake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/externals/find-modules/FindCatch2.cmake b/externals/find-modules/FindCatch2.cmake new file mode 100644 index 000000000..a83c668bf --- /dev/null +++ b/externals/find-modules/FindCatch2.cmake @@ -0,0 +1,35 @@ + +find_package(PkgConfig QUIET) +pkg_check_modules(PC_Catch2 QUIET Catch2) + +find_path(Catch2_INCLUDE_DIR + NAMES catch.hpp + PATHS ${PC_Catch2_INCLUDE_DIRS} ${CONAN_CATCH2_ROOT} + PATH_SUFFIXES catch2 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Catch2 + FOUND_VAR Catch2_FOUND + REQUIRED_VARS + Catch2_INCLUDE_DIR + VERSION_VAR Catch2_VERSION +) + +if(Catch2_FOUND) + set(Catch2_INCLUDE_DIRS ${Catch2_INCLUDE_DIR}) + set(Catch2_DEFINITIONS ${PC_Catch2_CFLAGS_OTHER}) +endif() + +if(Catch2_FOUND AND NOT TARGET Catch2::Catch2) + add_library(Catch2::Catch2 UNKNOWN IMPORTED) + set_target_properties(Catch2::Catch2 PROPERTIES + IMPORTED_LOCATION "${Catch2_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${PC_Catch2_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "${Catch2_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced( + Catch2_INCLUDE_DIR +) |