-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
59 lines (44 loc) · 2.17 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
cmake_minimum_required(VERSION 3.20)
project(prestosynth VERSION 0.1.0 LANGUAGES CXX C)
option(BUILD_TESTING "Avoid libsamplerate to build test." OFF)
#set(CMAKE_BUILD_TYPE Release)
#if(${CMAKE_BUILD_TYPE} EQUAL "Debug")
# message(STATUS "Debug building")
# add_compile_options(-fno-inline -g)
#endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mio)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libsamplerate)
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/MPMCQueue)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/eigen)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/gcem)
file(GLOB_RECURSE prestosynth_src src/*.cpp src/*.c)
foreach(src_file ${prestosynth_src})
message(STATUS "prestosynth_src: ${src_file}")
endforeach()
add_library(prestosynth ${prestosynth_src})
add_library(prestosynth::prestosynth ALIAS prestosynth)
target_compile_features(prestosynth PUBLIC cxx_std_17)
# force mio to use C++17, to make it compiled on macOS
target_include_directories(prestosynth PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(prestosynth mio)
target_link_libraries(prestosynth samplerate)
target_link_libraries(prestosynth eigen)
#target_link_libraries(prestosynth MPMCQueue)
target_link_libraries(prestosynth gcem)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# Examples
add_executable(readsfinfo ${CMAKE_CURRENT_SOURCE_DIR}/example/readsfinfo.cpp)
target_link_libraries(readsfinfo PRIVATE prestosynth)
add_executable(fetchsample ${CMAKE_CURRENT_SOURCE_DIR}/example/fetchsample.cpp)
target_link_libraries(fetchsample PRIVATE prestosynth)
add_executable(buildnote ${CMAKE_CURRENT_SOURCE_DIR}/example/buildnote.cpp)
target_link_libraries(buildnote PRIVATE prestosynth)
add_executable(render ${CMAKE_CURRENT_SOURCE_DIR}/example/render.cpp)
target_link_libraries(render PRIVATE prestosynth)
target_compile_features(render PRIVATE cxx_std_17)
# Tests
add_executable(test_conv ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_conv.cpp)
target_link_libraries(test_conv PRIVATE prestosynth)
# add_executable(test_filter ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_filter.cpp)
# target_link_libraries(test_filter PRIVATE prestosynth)
endif()