From 3faff570a28771ce88a802d54eaa5a880bdce873 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 2 Jan 2019 06:31:50 +0100 Subject: [PATCH] If Catch 2 and Catch 1 is not found, then abort. --- tests.CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests.CMakeLists.txt b/tests.CMakeLists.txt index 5e4fde4..f38d65e 100644 --- a/tests.CMakeLists.txt +++ b/tests.CMakeLists.txt @@ -3,8 +3,13 @@ if(WITH_TESTS) if(Catch2_FOUND) set(MYCATCH, Catch2::Catch2) else() - message(WARNING "Catch2 not found. Assuming Catch 1.x is installed.") - set(MYCATCH, "") + if(EXISTS "/usr/include/catch.hpp") + message(STATUS "Catch 1.x found.") + set(MYCATCH, "") + else() + message(FATAL_ERROR + "Neither Catch 2.x nor Catch 1.x could be found.") + endif() endif() include(CTest)