Files
netgen/0001-Optionally-use-system-provided-Catch2.patch
Atri Bhattacharya fa885d7154 Accepting request 1000067 from home:StefanBruens:branches:science
- Generate python stubs, add
  0001-Ignore-invalid-unknown-types-in-pybind11-docstrings.patch
- update to version 6.2.2203
  * no changelog provided
- Drop obsolete/upstream patches:
  * 0001-Set-explicit-OBJECT-library-type-for-internal-togl.patch
  * 0001-Throw-in-case-enum-value-is-unhandled.patch
  * 0001-Throw-Exception-when-shape-has-invalid-type.patch
  * 0001-Fix-signedness-for-ARM-Neon-mask-type.patch
- Add patches:
  * 0001-Link-nggui-to-FFMPEG-und-JPEG-libraries-when-needed.patch
  * 0001-Avoid-installation-of-Togl-static-library.patch
  * 0001-Fix-use-of-unitialized-stlgeometry-member-in-constru.patch
  * 0001-Include-filesystem-from-experimental-for-GCC-7.patch
  * 0001-Fix-netgen-executable-and-library-RUNPATHs.patch

OBS-URL: https://build.opensuse.org/request/show/1000067
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=28
2022-09-01 01:19:31 +00:00

62 lines
2.4 KiB
Diff

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