CMakeLists.txt 5.37 KB
Newer Older
Fabian Schlieper's avatar
Fabian Schlieper committed
1
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
Jonas Stienen's avatar
Jonas Stienen committed
2
3
4
5
6
7
8
9
10

project( ITADataSources )

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


# dependencies
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
11
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES )
Jonas Stienen's avatar
Jonas Stienen committed
12
13
vista_use_package( ASIO QUIET )
vista_use_package( Portaudio QUIET )
Fabian Schlieper's avatar
Fabian Schlieper committed
14
vista_use_package( JACK QUIET )
Jonas Stienen's avatar
Jonas Stienen committed
15

16
17
18
19
if( NOT DEFINED ITA_VISTA_BUILD_STATIC )
	set( ITA_VISTA_BUILD_STATIC OFF CACHE BOOL "Build against static ViSTA libraries" )
endif( NOT DEFINED ITA_VISTA_BUILD_STATIC )

20
21
22
23
if( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
	set( ITA_CORE_LIBS_BUILD_STATIC OFF CACHE BOOL "Build all ITA core libs in static mode" )
endif( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )

Jonas Stienen's avatar
Jonas Stienen committed
24
25
26
27
28
29
30
31
if( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO )
	set( ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO ${VASIO_FOUND} CACHE BOOL "Build with ASIO support" )
endif( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO )

if( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )
	set( ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO ${VPORTAUDIO_FOUND} CACHE BOOL "Build with Portaudio support" )
endif( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )

Fabian Schlieper's avatar
Fabian Schlieper committed
32
33
34
35
if( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )
	set( ITA_DATA_SOURCE_WITH_INTEGRATED_JACK ${VJACK_FOUND} CACHE BOOL "Build with JACK2 support" )
endif( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )

Jonas Stienen's avatar
Jonas Stienen committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49

# includes
include_directories( "include" )


# sources
set( ITADataSourcesHeader
	"include/ITABufferDataSink.h"
	"include/ITABufferDataSource.h"
	"include/ITADataSource.h"
	"include/ITADataSourceRealization.h"
	"include/ITADataSourcesDefinitions.h"
	"include/ITAFileDataSink.h"
	"include/ITAFileDataSource.h"
50
	"include/ITANetAudioStream.h"
51
	"include/ITANetAudioProtocol.h"
52
	"include/ITANetAudioSampleServer.h"
Jonas Stienen's avatar
Jonas Stienen committed
53
	"include/ITAPeakDetector.h"
54
	"include/ITARMSDetector.h"
Jonas Stienen's avatar
Jonas Stienen committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
	"include/ITAStreamAmplifier.h"
	"include/ITAStreamFunctionGenerator.h"
	"include/ITAStreamModalSynthesizer.h"
	"include/ITAStreamMultiplier1N.h"
	"include/ITAStreamPatchBay.h"
	"include/ITAStreamProbe.h"
	"include/ITAStreamProperties.h"
	"include/ITAStreamYJunction.h"
	)

set( ITADataSourcesSources
	"src/ITABufferDataSink.cpp"
	"src/ITABufferDataSource.cpp"
	"src/ITADataSource.cpp"
69
	"src/ITADataSourceRealization.cpp"	
Jonas Stienen's avatar
Jonas Stienen committed
70
71
	"src/ITAFileDataSink.cpp"
	"src/ITAFileDataSource.cpp"
72
	"src/ITANetAudioStream.cpp"
73
	"src/ITANetAudioProtocol.cpp"
74
	"src/ITANetAudioSampleServer.cpp"
Jonas Stienen's avatar
Jonas Stienen committed
75
	"src/ITAPeakDetector.cpp"
76
	"src/ITARMSDetector.cpp"
Jonas Stienen's avatar
Jonas Stienen committed
77
78
79
80
81
82
	"src/ITAStreamAmplifier.cpp"
	"src/ITAStreamFunctionGenerator.cpp"
	"src/ITAStreamModalSynthesizer.cpp"
	"src/ITAStreamMultiplier1N.cpp"
	"src/ITAStreamPatchBay.cpp"
	"src/ITAStreamProbe.cpp"
83
	"src/ITAStreamProperties.cpp"	
Jonas Stienen's avatar
Jonas Stienen committed
84
85
86
	"src/ITAStreamYJunction.cpp"
	)

Fabian Schlieper's avatar
Fabian Schlieper committed
87
88
list( APPEND ITADataSourcesSources "src/ITADataSourceUtils.cpp" )

89
90
# Filter windows-only components
if( WIN32 )
91
92
	list( APPEND ITADataSourcesHeader "include/ITAStreamPump.h" "include/ITADataSourceUtils.h" )
	list( APPEND ITADataSourcesSources "src/ITAStreamPump.cpp" "src/ITADataSourceUtils.cpp" )
93
94
endif( WIN32 )

Jonas Stienen's avatar
Jonas Stienen committed
95
if( VASIO_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO )
96
97
	list( APPEND ITADataSourcesHeader "include/ITAAsioInterface.h" )
	list( APPEND ITADataSourcesSources "src/ITAAsioInterface.cpp" )
Jonas Stienen's avatar
Jonas Stienen committed
98
99
	add_definitions( -DIEEE754_64FLOAT=1 )
endif( VASIO_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO )
Fabian Schlieper's avatar
Fabian Schlieper committed
100

Jonas Stienen's avatar
Jonas Stienen committed
101
if( VPORTAUDIO_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )
102
103
	list( APPEND ITADataSourcesHeader "include/ITAPortaudioInterface.h" )
	list( APPEND ITADataSourcesSources "src/ITAPortaudioInterface.cpp" )
Jonas Stienen's avatar
Jonas Stienen committed
104
105
endif( VPORTAUDIO_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )

Fabian Schlieper's avatar
Fabian Schlieper committed
106
107
108
109
110
if( VJACK_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )
	list( APPEND ITADataSourcesHeader "include/ITAJACKInterface.h" )
	list( APPEND ITADataSourcesSources "src/ITAJACKInterface.cpp" )
endif( VJACK_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )

Jonas Stienen's avatar
Jonas Stienen committed
111

112
# compiler settings
113
114
115
116
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( ITA_VISTA_BUILD_STATIC )

117
118
119
120
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_DATA_SOURCES_EXPORT )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
121
122
123
124
125
	set( BUILD_SHARED_LIBS_TEMP ${BUILD_SHARED_LIBS} )
	if( BUILD_SHARED_LIBS )
		set( BUILD_SHARED_LIBS OFF )
		message( "Ignoring activated BUILD_SHARED_LIBS temporary because static ITA core libs requested" )
	endif( BUILD_SHARED_LIBS )
126
127
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )

128

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
129
#target_compile_features(ITADataSources PRIVATE cxx_range_for)
130
if( NOT WIN32 )
131
	add_definitions( -std=c++11 )
132
endif( NOT WIN32)
Jonas Stienen's avatar
Jonas Stienen committed
133
134
135


# linker
136
add_library( ITADataSources ${ITADataSourcesHeader} ${ITADataSourcesSources} )
Jonas Stienen's avatar
Jonas Stienen committed
137
138
target_link_libraries( ITADataSources ${VISTA_USE_PACKAGE_LIBRARIES} )

139
140
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )

Jonas Stienen's avatar
Jonas Stienen committed
141
142
143
144
145
146
147
148
149
150
151

# config
vista_configure_lib( ITADataSources )
vista_install( ITADataSources )
set( ITADATASOURCES_INCLUDE_OUTDIR "${CMAKE_CURRENT_SOURCE_DIR}/include" )
vista_create_cmake_configs( ITADataSources )
vista_create_default_info_file( ITADataSources )

set_property( TARGET ITADataSources PROPERTY FOLDER "ITACoreLibs" )

	
152
# apps
153
154
set( ITADATASOURCES_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/apps/ita_whad" )
155
156


Jonas Stienen's avatar
Jonas Stienen committed
157
158
159
# tests
set( ITADATASOURCES_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )