CMakeLists.txt 3.4 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1
2
3
4
5
6
7
8
9
10
11
12
cmake_minimum_required( VERSION 2.8 )

project( ITAStreaming )

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

# dependencies
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ASIO )
vista_use_package( Portaudio )

13
14
15
16
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
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
if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_ASIO )
	set( ITA_STREAMING_WITH_BACKEND_ASIO ${VASIO_FOUND} CACHE BOOL "Build with ASIO for audio streaming" )
endif( NOT DEFINED ITA_STREAMING_WITH_BACKEND_ASIO )

if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_PORTAUDIO )
	set( ITA_STREAMING_WITH_BACKEND_PORTAUDIO OFF CACHE BOOL "Build with Portaudio for audio streaming" )
endif( NOT DEFINED ITA_STREAMING_WITH_BACKEND_PORTAUDIO )

if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_VIRTUAL )
	set( ITA_STREAMING_WITH_BACKEND_VIRTUAL ON CACHE BOOL "Build with virtual audio streaming backend" )
endif( NOT DEFINED ITA_STREAMING_WITH_BACKEND_VIRTUAL )


# includes
include_directories( "include" )


# sources
set( ITAStreamingHeader
	"include/ITAStreamingBackend.h"
	"include/ITAStreamingDefinitions.h"
	"include/ITAStreamingComponent.h"
	"include/ITAStreamingFunctionGenerator.h"
	"include/ITAStreamingDevice.h"
	"include/ITAStreamingProperties.h"
	"include/ITAStreamingSource.h"
	"include/ITAStreamingSourceRealization.h"
	"include/ITAStreamingState.h"
	)
set( ITAStreamingSources
	"src/ITAStreamingBackend.cpp"
	"src/ITAStreamingComponent.cpp"
	"src/ITAStreamingFunctionGenerator.cpp"
	"src/ITAStreamingProperties.cpp"
	"src/ITAStreamingSource.cpp"
	"src/ITAStreamingSourceRealization.cpp"
	"src/ITAStreamingState.cpp"
	)


if( ITA_STREAMING_WITH_BACKEND_ASIO AND VASIO_FOUND )
	set( ITAStreamingSources "${ITAStreamingSources}" "src/ITAStreamingBackendASIO.h" "src/ITAStreamingBackendASIO.cpp" )
	add_definitions( -DITA_STREAMING_WITH_BACKEND_ASIO -DIEEE754_64FLOAT=1 )
endif( ITA_STREAMING_WITH_BACKEND_ASIO AND VASIO_FOUND )

if( ITA_STREAMING_WITH_BACKEND_PORTAUDIO AND VPORTAUDIO_FOUND )
	set( ITAStreamingSources "${ITAStreamingSources}" "src/ITAStreamingBackendPortaudio.h" "src/ITAStreamingBackendPortaudio.cpp" )
	add_definitions( -DITA_STREAMING_WITH_BACKEND_PORTAUDIO )
endif( ITA_STREAMING_WITH_BACKEND_PORTAUDIO AND VPORTAUDIO_FOUND )

if( ITA_STREAMING_WITH_BACKEND_VIRTUAL )
	set( ITAStreamingHeader "${ITAStreamingHeader}" "include/ITAStreamingVirtualDevice.h" )
	set( ITAStreamingSources "${ITAStreamingSources}" "src/ITAStreamingVirtualDevice.cpp" )
endif( ITA_STREAMING_WITH_BACKEND_VIRTUAL )
	

# compiler
74
75
76
77
78
79
80

# compiler settings
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_STREAMING_EXPORT )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_BASE_STATIC -ITA_STREAMING_STATIC )
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
Jonas Stienen's avatar
Jonas Stienen committed
81
82
83


# linker
84
add_library( ITAStreaming ${ITAStreamingHeader} ${ITAStreamingSources} )
Jonas Stienen's avatar
Jonas Stienen committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
target_link_libraries( ITAStreaming ${VISTA_USE_PACKAGE_LIBRARIES} )


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

set_property( TARGET ITAStreaming PROPERTY FOLDER "ITACoreLibs" )

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