From e79b9eed755f0d12279a70a7fae83bf787c3f317 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>
Date: Wed, 19 Aug 2020 09:26:49 +0100
Subject: [PATCH 2/8] Unbundle catch
---
CMakeLists.txt | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8752c4c..c35d9b26 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -547,19 +547,11 @@ endif()
# Add tests if enabled
# =============================================================================
if(NRN_ENABLE_TESTS)
- add_external_project(catch2)
- set(CATCH_DIR ${PROJECT_SOURCE_DIR}/external/catch2)
- list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/external/catch2/contrib)
- include(CTest)
- include(Catch)
- find_python_module(pytest)
- find_python_module(pytest_cov)
- if(NRN_ENABLE_PYTHON)
- if(NOT PYTEST_FOUND)
- message(SEND_ERROR "pytest Python package is required.")
- elseif(NOT PYTEST_COV_FOUND)
- message(WARNING "pytest-cov package not installed. Python coverage will not be generated.")
- endif()
+ include(CTest)
+ find_package(Catch2 REQUIRED)
+ find_python_module(pytest)
+ if(NRN_ENABLE_PYTHON AND NOT PYTEST_FOUND)
+ message(SEND_ERROR "pytest Python package is required.")
endif()
# Initialize the submodule *before* including the test/CMakeLists.txt that uses it. This ensures
# that the test infrastructure can find the names of the input data files and set up rules to copy
--
2.35.1