CMakeLists.txt 5.28 KB
Newer Older
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
1
cmake_minimum_required(VERSION 3.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
if( NOT DEFINED ITA_DATA_SOURCES_WITH_INTEGRATED_ASIO )
	set( ITA_DATA_SOURCES_WITH_INTEGRATED_ASIO ${VASIO_FOUND} CACHE BOOL "Build with ASIO support" )
19
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
20

21 22
if( NOT DEFINED ITA_DATA_SOURCES_WITH_INTEGRATED_PORTAUDIO )
	set( ITA_DATA_SOURCES_WITH_INTEGRATED_PORTAUDIO ${VPORTAUDIO_FOUND} CACHE BOOL "Build with Portaudio support" )
23
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
24

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
if( NOT DEFINED ITA_DATA_SOURCES_WITH_INTEGRATED_JACK )
	set( ITA_DATA_SOURCES_WITH_INTEGRATED_JACK ${VJACK_FOUND} CACHE BOOL "Build with JACK2 support" )
endif( )

if( NOT DEFINED ITA_DATA_SOURCES_WITH_NET_AUDIO )
	set( ITA_DATA_SOURCES_WITH_NET_AUDIO ON CACHE BOOL "Build with NetAudio support" )
endif( )

if( NOT DEFINED ITA_DATA_SOURCES_NET_AUDIO_SHOW_TRAFFIC )
	set( ITA_DATA_SOURCES_NET_AUDIO_SHOW_TRAFFIC OFF CACHE BOOL "Show a lot of traffic information with NetAudio (debugging only)" )
	mark_as_advanced( ITA_DATA_SOURCES_NET_AUDIO_SHOW_TRAFFIC )
endif( )

if( ITA_DATA_SOURCES_NET_AUDIO_SHOW_TRAFFIC )
	add_definitions( -DNET_AUDIO_SHOW_TRAFFIC )
40
endif( )
Fabian Schlieper's avatar
Fabian Schlieper committed
41

Jonas Stienen's avatar
Jonas Stienen committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

# 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"
	"include/ITAPeakDetector.h"
57
	"include/ITARMSDetector.h"
Jonas Stienen's avatar
Jonas Stienen committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71
	"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"
72
	"src/ITADataSourceRealization.cpp"	
Jonas Stienen's avatar
Jonas Stienen committed
73 74 75
	"src/ITAFileDataSink.cpp"
	"src/ITAFileDataSource.cpp"
	"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
endif( )
94

95
if( VASIO_FOUND AND ITA_DATA_SOURCES_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
	add_definitions( -DIEEE754_64FLOAT=1 )
99
endif( )
Fabian Schlieper's avatar
Fabian Schlieper committed
100

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

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

111 112 113
if( ITA_DATA_SOURCES_WITH_NET_AUDIO )
	list( APPEND ITADataSourcesHeader
		"include/ITANetAudioStream.h"
114
		"include/ITANetAudioSampleServer.h"
115 116 117 118
		"include/ITANetAudioStreamingServer.h"
		)
	list( APPEND ITADataSourcesSources
		"src/ITANetAudioClient.cpp"
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
119
		"src/ITANetAudioClient.h"
120
		"src/ITANetAudioMessage.cpp"
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
121 122 123 124
		"src/ITANetAudioMessage.h"
		"src/ITANetAudioProtocol.h"
		"src/ITANetAudioServer.cpp"
		"src/ITANetAudioServer.h"
125 126
		"src/ITANetAudioStream.cpp"
		"src/ITANetAudioStreamingClient.cpp"
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
127
		"src/ITANetAudioStreamingClient.h"
128 129 130
		"src/ITANetAudioStreamingServer.cpp"
		)	
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
131

132
# compiler settings
133 134
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
135
endif( )
136

137
if( BUILD_SHARED_LIBS )
138
	add_definitions( -DITA_DATA_SOURCES_EXPORT )
139
else( )
140
	add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
141
endif( )
142

143

144
#target_compile_features(ITADataSources PRIVATE cxx_range_for)
145
if( NOT WIN32 )
146
	add_definitions( -std=c++11 )
147
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
148 149 150


# linker
151
add_library( ITADataSources ${ITADataSourcesHeader} ${ITADataSourcesSources} )
Jonas Stienen's avatar
Jonas Stienen committed
152 153 154 155 156 157 158 159 160 161 162 163 164
target_link_libraries( ITADataSources ${VISTA_USE_PACKAGE_LIBRARIES} )


# 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" )

	
165
# apps
166 167 168 169
if( ITA_CORE_LIBS_WITH_APPS )
	set( ITADATASOURCES_COMMON_BUILD TRUE )
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/apps/ita_whad" )
endif( )
170 171


Jonas Stienen's avatar
Jonas Stienen committed
172
# tests
173 174 175 176
if( ITA_CORE_LIBS_WITH_TESTS )
	set( ITADATASOURCES_COMMON_BUILD TRUE )
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif( )