CMakeLists.txt 3.21 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
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" )
15
endif( )
16

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

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

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


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

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

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

73 74

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

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


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