-
Dipl.-Ing. Jonas Stienen authoredDipl.-Ing. Jonas Stienen authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
CMakeLists.txt 3.25 KiB
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 QUIET )
vista_use_package( Portaudio QUIET )
vista_use_package( JACK QUIET )
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( )
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( )
if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_PORTAUDIO )
set( ITA_STREAMING_WITH_BACKEND_PORTAUDIO OFF CACHE BOOL "Build with Portaudio for audio streaming" )
endif( )
if( NOT DEFINED ITA_STREAMING_WITH_BACKEND_VIRTUAL )
set( ITA_STREAMING_WITH_BACKEND_VIRTUAL ON CACHE BOOL "Build with virtual audio streaming backend" )
endif( )
# 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( )
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( )
if( ITA_STREAMING_WITH_BACKEND_VIRTUAL )
set( ITAStreamingHeader "${ITAStreamingHeader}" "include/ITAStreamingVirtualDevice.h" )
set( ITAStreamingSources "${ITAStreamingSources}" "src/ITAStreamingVirtualDevice.cpp" )
endif( )
# compiler settings
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( )
if( BUILD_SHARED_LIBS )
add_definitions( -DITA_STREAMING_EXPORT )
else( )
add_definitions( -ITA_STREAMING_STATIC -DITA_BASE_STATIC )
endif( )
# linker
add_library( ITAStreaming ${ITAStreamingHeader} ${ITAStreamingSources} )
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
if( ITA_CORE_LIBS_WITH_TESTS )
set( ITASTREAMING_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif( )