-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
153 lines (147 loc) · 4.79 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
cmake_minimum_required(VERSION 3.16.0)
## GLOBAL CONFIGURATION
project(ov-client
LANGUAGES CXX
VERSION 0.5
DESCRIPTION "Headless clients to share and receive spatial realtime audio on Linux, MacOS and Windows hosts using JACK, zita-njbridge and TASCAR"
)
if (NOT DEFINED OVBOXVERSION)
set(OVBOXVERSION ${PROJECT_VERSION})
endif ()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
# DEPENDENCIES
find_package(Threads REQUIRED)
find_package(XercesC REQUIRED)
find_package(Jack REQUIRED)
find_package(LibSndFile REQUIRED)
find_package(LibSamplerate REQUIRED)
find_package(SoundIo REQUIRED)
find_package(FFTW REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(liblo REQUIRED)
find_package(GSL REQUIRED)
#find_package(LibXml++ REQUIRED)
set(PLUGINPREFIX "ovclient")
add_subdirectory(libov)
list(APPEND RECEIVERS
ortf
hrtf
simplefdn
omni
)
list(APPEND TASCARMODS
system
touchosc
waitforjackport
route
sleep
jackrec
)
list(APPEND SOURCEMODS
omni
cardioidmod
)
list(APPEND AUDIOPLUGINS
sndfile
delay
metronome
)
add_subdirectory(libov/tascar/plugins ${PROJECT_BINARY_DIR}/plugins)
get_property(TASCAR_PLUGIN_LIBRARIES GLOBAL PROPERTY TASCAR_PLUGIN_LIBRARIES)
add_subdirectory(zita-njbridge ${PROJECT_BINARY_DIR}/zita)
set(EXTERNAL_INCLUDES
PRIVATE
libov/src
${JACK_INCLUDE_DIRS}
${LIBXML++_INCLUDE_DIRS}
${LIBSNDFILE_INCLUDE_DIRS}
${LIBSAMPLERATE_INCLUDE_DIRS}
${SOUNDIO_INCLUDE_DIRS}
${LIBLO_INCLUDE_DIRS}
${FFTW_INCLUDE_DIRS})
set(EXTERNAL_LIBS
${JACK_LIBRARIES}
${LIBXML++_LIBRARIES}
${LIBSNDFILE_LIBRARIES}
${LIBSAMPLERATE_LIBRARIES}
${SOUNDIO_LIBRARIES}
${LIBLO_LIBRARIES}
${FFTW_LIBRARIES})
message("Tascar plugin: ${TASCAR_PLUGIN_LIBRARIES}")
# COMPILER ADDONS
add_compile_definitions(OVBOXVERSION="${OVBOXVERSION}")
# TARGET
# libovclient
# ov-client
add_executable(ov-client
${CMAKE_CURRENT_SOURCE_DIR}/src/ov-client.cc
)
target_link_libraries(ov-client
PRIVATE
ov
${EXTERNAL_LIBS}
PUBLIC
${TASCAR_PLUGIN_LIBRARIES}
)
target_include_directories(ov-client
PRIVATE
libov/src
${EXTERNAL_INCLUDES}
)
# ov-client_hostname
add_executable(ov-client_hostname ${CMAKE_CURRENT_SOURCE_DIR}/src/ov-client_hostname.cc)
target_link_libraries(ov-client_hostname PRIVATE ov ${EXTERNAL_LIBS})
target_include_directories(ov-client_hostname PRIVATE libov/src ${EXTERNAL_INCLUDES})
# ov-client_listsounddevs
add_executable(ov-client_listsounddevs ${CMAKE_CURRENT_SOURCE_DIR}/src/ov-client_listsounddevs.cc)
target_link_libraries(ov-client_listsounddevs PRIVATE ov ${EXTERNAL_LIBS})
target_include_directories(ov-client_listsounddevs PRIVATE libov/src ${EXTERNAL_INCLUDES})
set(CPACK_PACKAGE_EXECUTABLES ov-client)
if(APPLE AND BUILD_APP)
set(APP "${PROJECT_BINARY_DIR}/OVClient.app")
install(FILES
${PROJECT_SOURCE_DIR}/icon.icns
DESTINATION
${APP}/Contents/Resources/)
install(FILES
${PROJECT_BINARY_DIR}/zita/zita-n2j
DESTINATION
${APP}/Contents/MacOS)
install(FILES
${PROJECT_BINARY_DIR}/zita/zita-j2n
DESTINATION
${APP}/Contents/MacOS)
set_target_properties(ov-client PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_GUI_IDENTIFIER com.orlandoviols.ovclient
MACOSX_FRAMEWORK_IDENTIFIER com.orlandoviols.ovclient
MACOSX_BUNDLE_BUNDLE_NAME "OVClient"
OUTPUT_NAME "OVClient"
MACOSX_BUNDLE_ICON_FILE "icon.icns"
)
install(FILES "${PROJECT_BINARY_DIR}/zita/zita-n2j" "${PROJECT_BINARY_DIR}/zita/zita-j2n"
DESTINATION "${PROJECT_BINARY_DIR}/${APP}/MacOS"
)
install(TARGETS ov-client
BUNDLE
DESTINATION ${PROJECT_BINARY_DIR}
COMPONENT Runtime
)
set(DIRS
${CMAKE_BINARY_DIR}/plugins
${CMAKE_BINARY_DIR}/libov
${CMAKE_BINARY_DIR}/libov/libtascar
)
install(CODE "include(BundleUtilities)
fixup_bundle(\"${APP}\" \"\" \"${DIRS}\")
verify_app(\"${APP}\")
")
# CPACK
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_BUNDLE_NAME "OVClient")
set(CPACK_DMG_VOLUME_NAME "InstallOvClient")
include(CPack)
message("Use cpack to generate an app installer!")
endif()