CMakeLists.txt 11.2 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1
2
3
4
5
6
7
8
9
# $Id:$

cmake_minimum_required( VERSION 2.8 )
project( VACore )

list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )

include( VistaCommon )

10
11
12
13
if( NOT DEFINED ITA_VACORE_INSTALL_WITH_DLLS )
	set( ITA_VACORE_INSTALL_WITH_DLLS ON CACHE BOOL "Install VACore with depending DLLs (use this switch with care)" )
endif( NOT DEFINED ITA_VACORE_INSTALL_WITH_DLLS )

14
15
# Required packages
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES )
Jonas Stienen's avatar
Jonas Stienen committed
16
17
18
19
20
21
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAConvolution REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITACTC REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITASampler REQUIRED FIND_DEPENDENCIES )
22
vista_use_package( OpenDAFF REQUIRED )
Jonas Stienen's avatar
Jonas Stienen committed
23

24
25
# Optional packages
vista_find_package( RavenNet QUIET )
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

if( NOT DEFINED ITA_VACORE_VERSION_MAJOR )
	set( ITA_VACORE_VERSION_MAJOR 1 CACHE INT "VACore version major" )
endif( NOT DEFINED ITA_VACORE_VERSION_MAJOR )
if( NOT DEFINED ITA_VACORE_VERSION_MINOR )
	set( ITA_VACORE_VERSION_MINOR 24 CACHE INT "VACore version minor" )
endif( NOT DEFINED ITA_VACORE_VERSION_MINOR )

# Settings

if( NOT DEFINED ITA_VACORE_DEFAULT_DEBUG_LEVEL )
	set( ITA_VACORE_DEFAULT_DEBUG_LEVEL 3 CACHE INT "Default VACore debug level (0-5)" )
endif( NOT DEFINED ITA_VACORE_DEFAULT_DEBUG_LEVEL )
if( NOT DEFINED ITA_VACORE_MODULE_INTERFACE_ENABLED )
	set( ITA_VACORE_MODULE_INTERFACE_ENABLED ON CACHE BOOL "Build VACore with module interface" )
endif( NOT DEFINED ITA_VACORE_MODULE_INTERFACE_ENABLED )
if( NOT DEFINED ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION )
	set( ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION ON CACHE BOOL "Throw exception during module call attempt if VACore was build without module interface" )
endif( NOT DEFINED ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION )
45
46
47
48
49
50
51
52
53
54
55
56
if( NOT DEFINED ITA_VACORE_EVENTS_ENABLED )
	set( ITA_VACORE_EVENTS_ENABLED ON CACHE BOOL "VACore event handling" )
endif( NOT DEFINED ITA_VACORE_EVENTS_ENABLED )

if( NOT DEFINED ITA_VACORE_MAX_NUM_SOURCES )
	set( ITA_VACORE_MAX_NUM_SOURCES 0 CACHE INT "VACore maximum number of sound sources ( 0 = unlimited )" )
endif( NOT DEFINED ITA_VACORE_MAX_NUM_SOURCES )
if( NOT DEFINED ITA_VACORE_MAX_NUM_LISTENERS )
	set( ITA_VACORE_MAX_NUM_LISTENERS 0 CACHE INT "VACore maximum number of listeners ( 0 = unlimited )" )
endif( NOT DEFINED ITA_VACORE_MAX_NUM_LISTENERS )


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


# Rendering modules

if( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER )
	set( ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER ON CACHE BOOL "Build VACore with rendering module: ambient mixer" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER )

if( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBISONICS_FREEFIELD )
	set( ITA_VACORE_WITH_RENDERER_AMBISONICS_FREEFIELD ON CACHE BOOL "Build VACore with rendering module: ambisonics free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBISONICS_FREEFIELD )

if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_FREEFIELD )
	set( ITA_VACORE_WITH_RENDERER_BINAURAL_FREEFIELD ON CACHE BOOL "Build VACore with rendering module: binaural free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_FREEFIELD )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB )
	set( ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB ON CACHE BOOL "Build VACore with rendering module: artificial reverb" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS )
	set( ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS OFF CACHE BOOL "Build VACore with rendering module: room acoustics (RAVEN)" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE )
	set( ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE ON CACHE BOOL "Build VACore with rendering module: air traffic noise (VATSS)" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE )

if( NOT DEFINED ITA_VACORE_WITH_RENDERER_MONAURAL_FREEFIELD )
	set( ITA_VACORE_WITH_RENDERER_MONAURAL_FREEFIELD ON CACHE BOOL "Build VACore with rendering module: monaural free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_MONAURAL_FREEFIELD )

if( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY )
	set( ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY OFF CACHE BOOL "Build VACore with rendering module: prototype dummy" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID )
	set( ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID OFF CACHE BOOL "Build VACore with rendering module: prototype hearing aid (iCARE)" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH )
	set( ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH ON CACHE BOOL "Build VACore with rendering module: prototype generic path" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH )

if( NOT DEFINED ITA_VACORE_WITH_RENDERER_VBAP_FREEFIELD )
	set( ITA_VACORE_WITH_RENDERER_VBAP_FREEFIELD OFF CACHE BOOL "Build VACore with rendering module: vector-base amplitude panning free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_VBAP_FREEFIELD )


# Reproduction modules

if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH )
	set( ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH ON CACHE BOOL "Build VACore with reproduction module: talkthrough" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_HEADPHONES )
	set( ITA_VACORE_WITH_REPRODUCTION_HEADPHONES ON CACHE BOOL "Build VACore with reproduction module: headphones (equalization)" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_HEADPHONES )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS )
110
	set( ITA_VACORE_WITH_REPRODUCTION_AMBISONICS OFF CACHE BOOL "Build VACore with reproduction module: ambisonics (B-format decoder)" )
111
112
113
114
115
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC )
	set( ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC ON CACHE BOOL "Build VACore with reproduction module: binaural N-CTC" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN )
116
	set( ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN OFF CACHE BOOL "Build VACore with reproduction module: binaural mixdown" )
117
118
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN )
119
	set( ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN OFF CACHE BOOL "Build VACore with reproduction module: ambisonics binaural mixdown (B-format decoder)" )
120
121
122
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN )


Jonas Stienen's avatar
Jonas Stienen committed
123
124
125
126
127
128
129
# Including the source files of all source subfolders recursively
include( "include/_SourceFiles.cmake" )
include( "src/_SourceFiles.cmake" )

include_directories( "include" )

add_definitions( -DIEEE754_64FLOAT=1 )
130
add_definitions( -DVABASE_DLL -DITA_DATA_SOURCES_DLL -DITA_BASE_DLL -DITA_CONVOLUTION_DLL -DITA_CTC_DLL -DITA_SAMPLER_DLL -DVACORE_DLL -DVACORE_EXPORTS )
Jonas Stienen's avatar
Jonas Stienen committed
131

132
add_definitions( "-DVACORE_DEFAULT_LOG_LEVEL=${ITA_VACORE_DEFAULT_DEBUG_LEVEL}" )
133
134
add_definitions( "-DVACORE_VERSION_MAJOR=${ITA_VACORE_VERSION_MAJOR}" )
add_definitions( "-DVACORE_VERSION_MINOR=${ITA_VACORE_VERSION_MINOR}" )
135

136
137
138
139
140
141
142
143
144
if( ${ITA_VACORE_MODULE_INTERFACE_ENABLED} )
	add_definitions( "-DVACORE_MODULE_INTERFACE_ENABLED=1" )
endif()
if( ${ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION} )
	add_definitions( "-DVACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION=1" )
endif()
if( ${ITA_VACORE_EVENTS_ENABLED} )
	add_definitions( "-DVVACORE_EVENTS_ENABLED=1" )
endif()
145
146
147
add_definitions( "-DVACORE_MAX_NUM_SOURCES=${ITA_VACORE_MAX_NUM_SOURCES}" )
add_definitions( "-DVACORE_MAX_NUM_LISTENERS=${ITA_VACORE_MAX_NUM_LISTENERS}" )

148
149
150
151
152
153
154
# Rendering definitions
if( ${ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER} )
	add_definitions( "-DVACORE_WITH_RENDERER_AMBIENT_MIXER=1" )
endif()
if( ${ITA_VACORE_WITH_RENDERER_AMBISONICS_FREEFIELD} )
	add_definitions( "-DVACORE_WITH_RENDERER_AMBISONICS_FREEFIELD=1" )
endif()
155
156
157
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_FREEFIELD} )
	add_definitions( "-DVACORE_WITH_RENDERER_BINAURAL_FREEFIELD=1" )
endif()
158
159
160
161
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB} )
	add_definitions( "-DVACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB=1" )
endif()
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS} )
162
163
164
165
166
167
	if( RAVENNET_FOUND )
		vista_use_package( RavenNet REQUIRED FIND_DEPENDENCIES )
		add_definitions( "-DVACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS=1" )
	else( RAVENNET_FOUND )
		message( "Could not find RavenNet, which is required by binaural room acoustics audio renderer" )
	endif( RAVENNET_FOUND )
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
endif()
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE} )
	add_definitions( "-DVACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE=1" )
endif()
if( ${ITA_VACORE_WITH_RENDERER_MONAURAL_FREEFIELD} )
	add_definitions( "-DVACORE_WITH_RENDERER_MONAURAL_FREEFIELD=1" )
endif()
if( ${ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY} )
	add_definitions( "-DVACORE_WITH_RENDERER_PROTOTYPE_DUMMY=1" )
endif()
if( ${ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID} )
	add_definitions( "-DVACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID=1" )
endif()
if( ${ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH} )
	add_definitions( "-DVACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH=1" )
endif()
if( ${ITA_VACORE_WITH_RENDERER_VBAP_FREEFIELD} )
	add_definitions( "-DVACORE_WITH_RENDERER_VBAP_FREEFIELD=1" )
endif()

# Reproduction definitions
if( ${ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH} )
	add_definitions( "-DVACORE_WITH_REPRODUCTION_TALKTHROUGH=1" )
endif()
if( ${ITA_VACORE_WITH_REPRODUCTION_HEADPHONES} )
	add_definitions( "-DVACORE_WITH_REPRODUCTION_HEADPHONES=1" )
endif()
if( ${DVACORE_WITH_REPRODUCTION_AMBISONICS} )
	add_definitions( "-ITA_VACORE_WITH_REPRODUCTION_AMBISONICS=1" )
endif()
if( ${ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC} )
	add_definitions( "-DVACORE_WITH_REPRODUCTION_BINAURAL_NCTC=1" )
endif()
if( ${ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN} )
	add_definitions( "-DVACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN=1" )
endif()
if( ${ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN} )
	add_definitions( "-DVACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN=1" )
endif()
207
208
209

string( TIMESTAMP VACORE_CMAKE_DATE "%Y-%m-%d" )
add_definitions( "-DVACORE_CMAKE_DATE=\"${VACORE_CMAKE_DATE}\"" )
210

211
212
213
214
# Files
vista_add_files_to_sources( ProjectSources "conf" NON_RECURSIVE SOURCE_GROUP "conf" "ini" )
vista_add_files_to_sources( ProjectSources "data" SOURCE_GROUP_MIRROR_DIR "data" "wav" "daff" "mat" "ac" "skp" )

Jonas Stienen's avatar
Jonas Stienen committed
215
add_library( VACore ${ProjectSources} )
216
target_link_libraries( VACore ${VISTA_USE_PACKAGE_LIBRARIES} ) # contains all libraries from vista_use_package() calls 
Jonas Stienen's avatar
Jonas Stienen committed
217
218
219
220
221
222
223
224
225

vista_configure_lib( VACore )
set( VACORE_INCLUDE_OUTDIR "${CMAKE_CURRENT_SOURCE_DIR}/include" )
vista_install( VACore )
vista_create_cmake_configs( VACore )
vista_create_default_info_file( VACore )

set_property( TARGET VACore PROPERTY FOLDER "VA" )

226
227
228
if( ITA_VACORE_INSTALL_WITH_DLLS OR ITA_VA_INSTALL_WITH_DLLS )
	vista_install_all_dlls( bin )
endif()
Jonas Stienen's avatar
Jonas Stienen committed
229
230
231
232

# tests
set( VACORE_COMMON_BUILD TRUE )
#add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )