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

project( ITADataSources )

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 )
Fabian Schlieper's avatar
Fabian Schlieper committed
13
vista_use_package( JACK QUIET )
Jonas Stienen's avatar
Jonas Stienen committed
14

15 16 17 18
if( NOT DEFINED ITA_VISTA_BUILD_STATIC )
	set( ITA_VISTA_BUILD_STATIC OFF CACHE BOOL "Build against static ViSTA libraries" )
endif( NOT DEFINED ITA_VISTA_BUILD_STATIC )

19 20 21 22
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
23 24 25 26 27 28 29 30
if( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO )
	set( ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO ${VASIO_FOUND} CACHE BOOL "Build with ASIO support" )
endif( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_ASIO )

if( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )
	set( ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO ${VPORTAUDIO_FOUND} CACHE BOOL "Build with Portaudio support" )
endif( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )

Fabian Schlieper's avatar
Fabian Schlieper committed
31 32 33 34
if( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )
	set( ITA_DATA_SOURCE_WITH_INTEGRATED_JACK ${VJACK_FOUND} CACHE BOOL "Build with JACK2 support" )
endif( NOT DEFINED ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )

Jonas Stienen's avatar
Jonas Stienen committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

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

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

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

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

Jonas Stienen's avatar
Jonas Stienen committed
96
if( VPORTAUDIO_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )
97 98
	list( APPEND ITADataSourcesHeader "include/ITAPortaudioInterface.h" )
	list( APPEND ITADataSourcesSources "src/ITAPortaudioInterface.cpp" )
Jonas Stienen's avatar
Jonas Stienen committed
99 100
endif( VPORTAUDIO_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_PORTAUDIO )

Fabian Schlieper's avatar
Fabian Schlieper committed
101 102 103 104 105
if( VJACK_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )
	list( APPEND ITADataSourcesHeader "include/ITAJACKInterface.h" )
	list( APPEND ITADataSourcesSources "src/ITAJACKInterface.cpp" )
endif( VJACK_FOUND AND ITA_DATA_SOURCE_WITH_INTEGRATED_JACK )

Jonas Stienen's avatar
Jonas Stienen committed
106

107
# compiler settings
108 109 110 111
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( ITA_VISTA_BUILD_STATIC )

112 113 114 115
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_DATA_SOURCES_EXPORT )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
116 117 118 119 120
	set( BUILD_SHARED_LIBS_TEMP ${BUILD_SHARED_LIBS} )
	if( BUILD_SHARED_LIBS )
		set( BUILD_SHARED_LIBS OFF )
		message( "Ignoring activated BUILD_SHARED_LIBS temporary because static ITA core libs requested" )
	endif( BUILD_SHARED_LIBS )
121 122
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )

123

124
if( NOT WIN32 )
125
	add_definitions( -std=c++11 )
126
endif( NOT WIN32)
Jonas Stienen's avatar
Jonas Stienen committed
127 128 129


# linker
130
add_library( ITADataSources ${ITADataSourcesHeader} ${ITADataSourcesSources} )
Jonas Stienen's avatar
Jonas Stienen committed
131 132
target_link_libraries( ITADataSources ${VISTA_USE_PACKAGE_LIBRARIES} )

Fabian Schlieper's avatar
Fabian Schlieper committed
133 134
#target_compile_features(ITADataSources PRIVATE cxx_range_for)

135 136 137
if( NOT WIN32 
	add_definitions( -std=c++11 )
endif()
Fabian Schlieper's avatar
Fabian Schlieper committed
138 139


140 141
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )

Jonas Stienen's avatar
Jonas Stienen committed
142 143 144 145 146 147 148 149 150 151 152

# 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" )

	
153
# apps
154 155
set( ITADATASOURCES_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/apps/ita_whad" )
156 157


Jonas Stienen's avatar
Jonas Stienen committed
158 159 160
# tests
set( ITADATASOURCES_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )