-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
114 lines (94 loc) · 3.45 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
cmake_minimum_required(VERSION 3.6)
project(pd-externals VERSION 0.1 LANGUAGES C CXX)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(GNUWarnings)
include(FindPkgConfigLibrary)
include(PdExternal)
include(PdDeken)
enable_gnu_warning("all")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_VISIBILITY_PRESET "hidden")
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package(OpenMP)
if(OpenMP_FOUND)
add_compile_options("${OpenMP_C_FLAGS}") # only for compiling, not linking
endif()
set(USE_LIBCXX_INIT OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(USE_LIBCXX_INIT ON)
endif()
option(USE_LIBCXX "Use libc++" "${USE_LIBCXX_INIT}")
if(USE_LIBCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
include_directories(
"${PROJECT_SOURCE_DIR}/src")
include_directories(
"${PROJECT_SOURCE_DIR}/thirdparty/GSL/include")
include_directories(
"${PROJECT_SOURCE_DIR}/thirdparty/jsl/include")
if(PDEX_DOUBLE)
pkg_check_library(jpc-fftw fftw3)
else()
pkg_check_library(jpc-fftw fftw3f)
endif()
if(NOT jpc-fftw_FOUND)
message(STATUS "FFTW not found, some externals will not be built")
endif()
################################################################################
add_library(blepvco-common STATIC
src/blepvco/blepvco.cc
src/blepvco/minblep_tables.cc)
target_include_directories(blepvco-common
PUBLIC ${PD_INCLUDE_DIRS})
if(PDEX_DOUBLE)
target_compile_definitions(blepvco-common
PRIVATE "PD_FLOATSIZE=64")
endif()
add_pd_external(bleprect_tilde src/blepvco/bleprect~.cc)
target_link_libraries(bleprect_tilde blepvco-common)
add_pd_external(blepsaw_tilde src/blepvco/blepsaw~.cc)
target_link_libraries(blepsaw_tilde blepvco-common)
add_pd_external(bleptri_tilde src/blepvco/bleptri~.cc)
target_link_libraries(bleptri_tilde blepvco-common)
################################################################################
add_pd_external(tri_tilde src/jpc/tri~.cc)
add_pd_external(sincos src/jpc/sincos.cc)
add_pd_external(lfos_tilde src/jpc/lfos~.cc)
add_pd_external(miditranspose src/jpc/miditranspose.cc)
add_pd_external(midiselect src/jpc/midiselect.cc)
################################################################################
add_pd_external(bbd_tilde src/dafx/bbd~.cc)
add_pd_external(limit_tilde src/dafx/limit~.cc)
if(jpc-fftw_FOUND)
add_pd_external(robot_tilde src/dafx/robot~.cc)
target_link_libraries(robot_tilde jpc-fftw)
endif()
################################################################################
add_pd_external(delayA_tilde src/stk/delayA~.cc)
add_pd_external(nlcubic_tilde src/stk/nlcubic~.cc)
################################################################################
add_pd_external(dcremove_tilde src/swh/dcremove~.cc)
################################################################################
add_pd_external(opl3_tilde
src/chip/opl3~.cc
src/chip/opl3/nukedopl/opl3.c
src/chip/opl3/driver/OPLSynth.cc
src/chip/opl3/driver/OPLPatch.cc)
################################################################################
add_deken_package(jpcex "${PROJECT_VERSION}"
TARGETS
bleprect_tilde blepsaw_tilde bleptri_tilde
tri_tilde sincos lfos_tilde miditranspose midiselect
bbd_tilde limit_tilde robot_tilde
delayA_tilde nlcubic_tilde
dcremove_tilde
opl3_tilde
FILES
help-*.pd CMakeLists.txt README.md LICENSE.md
DIRS
src thirdparty cmake
EXCLUDE
"/\\.git$" "^thirdparty/GSL/tests/")