CMakeLists.txt 5.36 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

# 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"
56
	"include/ITAStreamDetector.h"
Jonas Stienen's avatar
Jonas Stienen committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70
	"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"
71
	"src/ITADataSourceRealization.cpp"	
Jonas Stienen's avatar
Jonas Stienen committed
72 73
	"src/ITAFileDataSink.cpp"
	"src/ITAFileDataSource.cpp"
74
	"src/ITAStreamDetector.cpp"
Jonas Stienen's avatar
Jonas Stienen committed
75 76 77 78 79 80
	"src/ITAStreamAmplifier.cpp"
	"src/ITAStreamFunctionGenerator.cpp"
	"src/ITAStreamModalSynthesizer.cpp"
	"src/ITAStreamMultiplier1N.cpp"
	"src/ITAStreamPatchBay.cpp"
	"src/ITAStreamProbe.cpp"
81
	"src/ITAStreamProperties.cpp"	
Jonas Stienen's avatar
Jonas Stienen committed
82 83 84
	"src/ITAStreamYJunction.cpp"
	)

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

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

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

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

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

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

130
# compiler settings
131 132
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
133 134 135
	if( WIN32 )
		list( APPEND VISTA_USE_PACKAGE_LIBRARIES Ws2_32 )
	endif( )
136
endif( )
137

138
if( BUILD_SHARED_LIBS )
139
	add_definitions( -DITA_DATA_SOURCES_EXPORT )
140
else( )
141 142 143 144 145
	add_definitions( -DITA_DATA_SOURCES_STATIC )
endif( )

if( ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_BASE_STATIC )
146
endif( )
147

148

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
149
#target_compile_features(ITADataSources PRIVATE cxx_range_for)
150
if( NOT WIN32 )
151
	add_definitions( -std=c++11 )
152
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
153 154 155


# linker
156
add_library( ITADataSources ${ITADataSourcesHeader} ${ITADataSourcesSources} )
Jonas Stienen's avatar
Jonas Stienen committed
157 158 159 160 161 162 163 164 165 166 167 168 169
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" )

	
170
# apps
171 172 173 174
if( ITA_CORE_LIBS_WITH_APPS )
	set( ITADATASOURCES_COMMON_BUILD TRUE )
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/apps/ita_whad" )
endif( )
175 176


Jonas Stienen's avatar
Jonas Stienen committed
177
# tests
178 179 180 181
if( ITA_CORE_LIBS_WITH_TESTS )
	set( ITADATASOURCES_COMMON_BUILD TRUE )
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif( )