-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
60 lines (48 loc) · 2.06 KB
/
CMakeLists.txt
File metadata and controls
60 lines (48 loc) · 2.06 KB
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
cmake_minimum_required(VERSION 3.14)
option(NEO_PLUGIN_SUPPORT "Enable plugin support (e.g. atomic variables)" OFF)
option(NEO_BUILD_TESTS "Build unit tests" OFF)
project(neuron VERSION 0.1.0 LANGUAGES CXX)
file(GLOB_RECURSE SRC_FILES "src/*.cpp")
add_library(neuron STATIC ${SRC_FILES})
if (NEO_PLUGIN_SUPPORT)
set_target_properties(neuron PROPERTIES
PUBLIC
CXX_STANDARD 23
CXX_STANDARD_REQUIRED
OSX_ARCHITECTURES "x86_64;arm64")
target_compile_definitions(neuron PUBLIC NEO_PLUGIN_SUPPORT)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set_target_properties(neuron PROPERTIES
PUBLIC
CXX_STANDARD 14
CXX_STANDARD_REQUIRED)
endif ()
target_include_directories(neuron
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src)
if (NEO_BUILD_TESTS)
function(add_neuron_test name src)
add_executable("${name}_test_exe" ${src})
target_link_libraries("${name}_test_exe" PRIVATE neuron gtest gtest_main gmock gmock_main)
add_test(NAME "${name}_test" COMMAND "${name}_test_exe")
endfunction()
add_subdirectory(vendor/googletest)
enable_testing()
if (NEO_PLUGIN_SUPPORT)
add_neuron_test(parameter_atomic tests/core/parameter_test_atomic.cpp)
endif ()
add_neuron_test(parameter tests/core/parameter_test.cpp)
add_neuron_test(oscillator tests/dsp/generators/oscillator_test.cpp)
add_neuron_test(adsr tests/dsp/modulators/adsr_test.cpp)
add_neuron_test(saturator tests/dsp/processors/saturator_test.cpp)
add_neuron_test(wavefolder tests/dsp/processors/wavefolder_test.cpp)
add_neuron_test(filter tests/dsp/processors/filter_test.cpp)
add_neuron_test(arithmetic tests/utils/arithmetic_test.cpp)
add_neuron_test(midi tests/utils/midi_test.cpp)
add_neuron_test(smoothed_value tests/utils/smoothed_value_test.cpp)
add_neuron_test(waveform tests/utils/waveform_test.cpp)
endif ()