Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP4:SLECandidates
netgen
0001-Optionally-use-system-provided-Catch2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Optionally-use-system-provided-Catch2.patch of Package netgen
From f1017faee9a057f86be34abd3926189623d73cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de> Date: Wed, 3 Mar 2021 18:45:22 +0100 Subject: [PATCH] Optionally use system provided Catch2 Most external_projects are only fetched on Windows and/or MacOS, but are assumed to be available on Linux. The only outlier is Catch2. In case netgen is build in an isolated environment, fetching Catch2 will fail, even when Catch2 is available as a system package. --- CMakeLists.txt | 13 ++++++++++++- cmake/SuperBuild.cmake | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20c01740..caca0bfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,8 @@ option( DEBUG_LOG "Enable more debug output (may increase computation time) - on option( CHECK_RANGE "Check array range access, automatically enabled if built in debug mode" OFF) option( BUILD_STUB_FILES "Build stub files for better autocompletion" ON) option( BUILD_FOR_CONDA "Link python libraries only to executables" OFF) +option( DOWNLOAD_DEPENDENCIES "Download any dependencies not found on the system" ON) + option( USE_SUPERBUILD "build dependencies automatically" ON) option( TRACE_MEMORY "Enable memory tracing" OFF) @@ -479,7 +481,16 @@ enable_testing() include(CTest) if(ENABLE_UNIT_TESTS) - include(${CMAKE_CURRENT_LIST_DIR}/cmake/external_projects/catch.cmake) + if(DOWNLOAD_DEPENDENCIES) + include(${CMAKE_CURRENT_LIST_DIR}/cmake/external_projects/catch.cmake) + else(DOWNLOAD_DEPENDENCIES) + find_package(Catch2 REQUIRED) + set_target_properties(Catch2::Catch2 PROPERTIES IMPORTED_GLOBAL TRUE) + add_library(project_catch ALIAS Catch2::Catch2) + get_target_property(_CATCH_INCLUDE_DIR_BASE Catch2::Catch2 INTERFACE_INCLUDE_DIRECTORIES) + string(CONCAT CATCH_INCLUDE_DIR ${_CATCH_INCLUDE_DIR_BASE} "/catch2") + endif(DOWNLOAD_DEPENDENCIES) + message(STATUS "Catch2 include dir: ${CATCH_INCLUDE_DIR}") endif(ENABLE_UNIT_TESTS) diff --git a/cmake/SuperBuild.cmake b/cmake/SuperBuild.cmake index 13d6915a..6c33d6e9 100644 --- a/cmake/SuperBuild.cmake +++ b/cmake/SuperBuild.cmake @@ -232,6 +232,7 @@ set_vars( NETGEN_CMAKE_ARGS INTEL_MIC CMAKE_INSTALL_PREFIX ENABLE_UNIT_TESTS + DOWNLOAD_DEPENDENCIES ENABLE_CPP_CORE_GUIDELINES_CHECK USE_SPDLOG DEBUG_LOG -- 2.36.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor