From 2d8476e87532d1c833689f61f51ff1b0b38da98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carreira?= Date: Sun, 2 May 2021 23:55:07 +0100 Subject: [PATCH] Start adding cmake code to use catch2 --- CMakeLists.txt | 6 ++++++ lib/CMakeLists.txt | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a29b8e..786af05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ OPTION(BUILD_TOOLS "Build Command Line Application" ON) OPTION(BUILD_EXAMPLES "Build Examples" OFF) OPTION(BUILD_DOC "Build Documentation" OFF) OPTION(BUILD_TESTS "Build Google Tests" OFF) +OPTION(BUILD_TESTS_CATCH2 "Build Catch2 Tests" OFF) OPTION(USE_FERVOR "Add Fervor support" OFF) @@ -124,6 +125,11 @@ IF(BUILD_TESTS) ) ENDIF() +IF(BUILD_TESTS_CATCH2) + FIND_PACKAGE(Catch2 REQUIRED) + ENABLE_TESTING() +ENDIF() + OPTION(USE_OPENCV "Add OpenCV support" ON) IF(USE_OPENCV) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 9dec7f3..2853ada 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -85,3 +85,7 @@ ENDIF() IF(BUILD_TESTS) ADD_SUBDIRECTORY(tests) ENDIF() + +IF(BUILD_TESTS_CATCH2) + ADD_SUBDIRECTORY(catch2) +ENDIF() \ No newline at end of file