-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
120 lines (97 loc) · 3.7 KB
/
CMakeLists.txt
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
cmake_minimum_required(VERSION 3.10)
project(sst-effects VERSION 0.5 LANGUAGES C CXX)
option(SST_EFFECTS_BUILD_EXAMPLES "Build the example drivers (which will also acivate tests)" OFF)
option(SST_EFFECTS_BUILD_TESTS "Build the test harness" OFF)
set(CMAKE_CXX_STANDARD 17)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE include)
# there's a bit more below this
if (${SST_EFFECTS_BUILD_EXAMPLES})
set(SST_EFFECTS_BUILD_TESTS ON)
endif()
if (${SST_EFFECTS_BUILD_TESTS})
message(STATUS "Building tests")
include(cmake/CPM.cmake)
if (NOT TARGET simde)
CPMAddPackage(NAME simde
GITHUB_REPOSITORY simd-everywhere/simde
VERSION 0.7.2
)
add_library(simde INTERFACE)
target_include_directories(simde INTERFACE ${simde_SOURCE_DIR})
endif ()
if (NOT TARGET sst-basic-blocks)
CPMAddPackage(NAME sst-basic-blocks
GITHUB_REPOSITORY surge-synthesizer/sst-basic-blocks
GIT_TAG main
)
endif ()
if (NOT TARGET sst-filters)
CPMAddPackage(NAME sst-filters
GITHUB_REPOSITORY surge-synthesizer/sst-filters
GIT_TAG main
)
endif ()
if (NOT TARGET sst-waveshapers)
CPMAddPackage(NAME sst-waveshapers
GITHUB_REPOSITORY surge-synthesizer/sst-waveshapers
GIT_TAG main
)
endif ()
if (NOT TARGET fmt)
CPMAddPackage(NAME fmt
GITHUB_REPOSITORY fmtlib/fmt
GIT_TAG master
)
endif ()
if (NOT TARGET eurorack)
CPMAddPackage(NAME eurorack
GITHUB_REPOSITORY surge-synthesizer/eurorack
GIT_TAG surge
)
endif ()
add_executable(${PROJECT_NAME}-test
tests/sst-effects-test.cpp
tests/create-effect.cpp
tests/create-voice-effect.cpp
tests/concrete-runs.cpp
tests/sfinae-test.cpp
)
if (MSVC)
target_compile_definitions(${PROJECT_NAME}-test
PUBLIC
/wd4244
/wd4267
/wd4101
/wd4305)
endif()
target_link_libraries(${PROJECT_NAME}-test PUBLIC simde sst-basic-blocks sst-filters sst-waveshapers fmt ${PROJECT_NAME})
target_compile_definitions(${PROJECT_NAME}-test PUBLIC _USE_MATH_DEFINES=1)
target_compile_definitions(${PROJECT_NAME}-test PRIVATE CATCH_CONFIG_DISABLE_EXCEPTIONS=1)
target_include_directories(${PROJECT_NAME}-test PRIVATE libs/catch2)
if(${SST_EFFECTS_BUILD_EXAMPLES})
message(STATUS "Building Examples / CLI Driver")
if (NOT TARGET dr_libs)
CPMAddPackage(NAME dr_libs
GITHUB_REPOSITORY mackron/dr_libs
GIT_TAG master
)
add_library(dr_libs INTERFACE)
target_include_directories(dr_libs INTERFACE ${dr_libs_SOURCE_DIR})
CPMAddPackage(NAME CL11
GITHUB_REPOSITORY CLIUtils/CLI11
GIT_TAG main)
endif ()
add_executable(CLIExample
examples/CLIExample.cpp
)
target_link_libraries(CLIExample PUBLIC dr_libs CLI11::CLI11 simde sst-basic-blocks sst-filters sst-waveshapers fmt ${PROJECT_NAME})
target_compile_definitions(CLIExample PUBLIC _USE_MATH_DEFINES=1)
endif()
endif ()
if (TARGET eurorack)
target_link_libraries(${PROJECT_NAME} INTERFACE eurorack)
target_compile_definitions(${PROJECT_NAME} INTERFACE SST_EFFECTS_EURORACK=1)
else()
message(STATUS "sst-effects built without eurorack library; Nimbus effect is no-op")
endif()