CMakeLists.txt 3.25 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1 2 3 4 5 6 7 8 9
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 )
10 11 12
vista_use_package( ASIO QUIET )
vista_use_package( Portaudio QUIET )
vista_use_package( JACK QUIET )
Jonas Stienen's avatar
Jonas Stienen committed
13

14 15
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" )
16
endif( )
17

Jonas Stienen's avatar
Jonas Stienen committed
18 19
if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_ASIO )
	set( ITA_STREAMING_WITH_BACKEND_ASIO ${VASIO_FOUND} CACHE BOOL "Build with ASIO for audio streaming" )
20
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
21 22 23

if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_PORTAUDIO )
	set( ITA_STREAMING_WITH_BACKEND_PORTAUDIO OFF CACHE BOOL "Build with Portaudio for audio streaming" )
24
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
25 26 27

if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_VIRTUAL )
	set( ITA_STREAMING_WITH_BACKEND_VIRTUAL ON CACHE BOOL "Build with virtual audio streaming backend" )
28
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
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


# 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 )
61
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
62 63 64 65

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 )
66
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
67 68 69 70

if( ITA_STREAMING_WITH_BACKEND_VIRTUAL )
	set( ITAStreamingHeader "${ITAStreamingHeader}" "include/ITAStreamingVirtualDevice.h" )
	set( ITAStreamingSources "${ITAStreamingSources}" "src/ITAStreamingVirtualDevice.cpp" )
71
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
72 73
	

74 75

# compiler settings
76 77 78 79 80
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( )

if( BUILD_SHARED_LIBS )
81
	add_definitions( -DITA_STREAMING_EXPORT )
82 83 84
else( )
	add_definitions( -ITA_STREAMING_STATIC -DITA_BASE_STATIC )
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
85 86 87


# linker
88
add_library( ITAStreaming ${ITAStreamingHeader} ${ITAStreamingSources} )
Jonas Stienen's avatar
Jonas Stienen committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102
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
103 104 105 106
if( ITA_CORE_LIBS_WITH_TESTS )
	set( ITASTREAMING_COMMON_BUILD TRUE )
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif( )