blob: 01d716020ea31ffddd42fa176e5a17eb39a51a23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
--- ableton-link.orig/cmake_include/CatchConfig.cmake
+++ ableton-link/cmake_include/CatchConfig.cmake
@@ -1,6 +1,12 @@
-add_library(Catch::Catch IMPORTED INTERFACE)
+if (NEED_CATCH2 MATCHES "ON")
+ add_library(Catch::Catch IMPORTED INTERFACE)
-set_property(TARGET Catch::Catch APPEND PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES
- ${CMAKE_CURRENT_LIST_DIR}/../third_party/catch
-)
+ find_package(Catch2 CONFIG REQUIRED)
+ if(Catch2_FOUND)
+ message(STATUS "Dependency Catch2 found in ${Catch2_DIR}")
+ set_property(TARGET Catch::Catch APPEND PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES
+ ${Catch2_DIR}/../../include
+ )
+ endif()
+endif()
--- "a/src/CMakeLists.txt"
+++ "b/src/CMakeLists.txt"
@@ -77,4 +77,9 @@ function(configure_link_test_executable target)
function(configure_link_test_executable target)
- target_link_libraries(${target} Catch::Catch Ableton::Link)
+ if (NEED_CATCH2 MATCHES "ON")
+ target_link_libraries(${target} Catch2::Catch2WithMain Ableton::Link)
target_compile_definitions(${target} PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING=1)
+ else()
+ target_link_libraries(${target} Ableton::Link)
+ target_compile_definitions(${target} PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING=0)
+ endif()
endfunction()
--- "a/src/ableton/link/tst_LinearRegression.cpp"
+++ "b/src/ableton/link/tst_LinearRegression.cpp"
@@ -22,6 +22,8 @@
#include <array>
#include <vector>
+using Catch::Approx;
+
namespace ableton
{
namespace link
--- "a/src/ableton/link/tst_Beats.cpp"
+++ "b/src/ableton/link/tst_Beats.cpp"
@@ -20,6 +20,8 @@
#include <ableton/link/Beats.hpp>
#include <ableton/test/CatchWrapper.hpp>
+using Catch::Approx;
+
namespace ableton
{
namespace link
--- "a/src/ableton/link/tst_Median.cpp"
+++ "b/src/ableton/link/tst_Median.cpp"
@@ -22,6 +22,8 @@
#include <array>
#include <vector>
+using Catch::Approx;
+
namespace ableton
{
namespace link
--- "a/src/ableton/link/tst_Tempo.cpp"
+++ "b/src/ableton/link/tst_Tempo.cpp"
@@ -20,6 +20,8 @@
#include <ableton/link/Tempo.hpp>
#include <ableton/test/CatchWrapper.hpp>
+using Catch::Approx;
+
namespace ableton
{
namespace link
|