SHA256
1
0
forked from pool/trng
trng/trng-external-catch.patch
Dirk Mueller 9aeda8eccd Accepting request 1119604 from home:badshah400:branches:devel:libraries:c_c++
* Update to version 4.25.
* Add trng-external-catch.patch -- Allow using external Catch2 for building and running tests (gh#rabauke/trng4#30).
* Drop trng-drop-findtbb-cmake-module.patch: fixed upstream.

OBS-URL: https://build.opensuse.org/request/show/1119604
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/trng?expand=0&rev=9
2023-10-24 08:19:29 +00:00

26 lines
904 B
Diff

Index: trng4-4.25/CMakeLists.txt
===================================================================
--- trng4-4.25.orig/CMakeLists.txt
+++ trng4-4.25/CMakeLists.txt
@@ -14,6 +14,7 @@ endif()
option(TRNG_ENABLE_TESTS "Enable/Disable the compilation of the TRNG tests" ON)
option(TRNG_ENABLE_EXAMPLES "Enable/Disable the compilation of the TRNG examples" ON)
+option(USE_EXTERNAL_CATCH "Use system installed Catch2" ON)
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wmaybe-uninitialized")
@@ -42,7 +43,11 @@ configure_package_config_file("cmake/Con
add_subdirectory(trng)
if(TRNG_ENABLE_TESTS)
- add_subdirectory(external/Catch2)
+ if(USE_EXTERNAL_CATCH)
+ find_package(Catch2 2 REQUIRED)
+ else(USE_EXTERNAL_CATCH)
+ add_subdirectory(external/Catch2)
+ endif()
add_subdirectory(tests)
endif()
if(TRNG_ENABLE_EXAMPLES)