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

project( ITACTC )

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

# dependencies
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAFFT REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAConvolution REQUIRED FIND_DEPENDENCIES )
vista_use_package( OpenDAFF REQUIRED )

15
16
17
18
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
19
20
21
22
23
24
25
26
27
28
29
30
if( NOT DEFINED ITA_CTC_WITH_DUAL_CTC )
	set( ITA_CTC_WITH_DUAL_CTC OFF CACHE BOOL "Build support for Crosstalk-Cancellation with arbitrary loudspeaker number and pose" )
endif( NOT DEFINED ITA_CTC_WITH_DUAL_CTC )

if( NOT DEFINED ITA_CTC_WITH_N_CTC )
	set( ITA_CTC_WITH_N_CTC ON CACHE BOOL "Build support for two-loudspeaker Crosstalk-Cancellation (deprecated)" )
endif( NOT DEFINED ITA_CTC_WITH_N_CTC )

if( NOT DEFINED ITA_CTC_WITH_QUAD_CTC )
	set( ITA_CTC_WITH_QUAD_CTC OFF CACHE BOOL "Build support for quad-loudspeaker Crosstalk-Cancellation (deprecated)" )
endif( NOT DEFINED ITA_CTC_WITH_QUAD_CTC )

31
32
33
34
if( NOT DEFINED ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )
	set( ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE OFF CACHE BOOL "Export HRIR input,, intermediate results and final CTC filter set to harddrive (as multi-channel WAV files)" )
endif( NOT DEFINED ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )

Jonas Stienen's avatar
Jonas Stienen committed
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

# includes
include_directories( "include" )


# sources
set( ITACTCHeader
	"include/ITACTCDefinitions.h"
	"include/ITACTCUtils.h"
	"include/ITAHDFTSpectra.h"
	)
set( ITACTCSources
	"src/ITACTCUtils.cpp"
	"src/ITAHDFTSpectra.cpp"
	)

if( ITA_CTC_WITH_DUAL_CTC )
	set( ITACTCHeader "${ITACTCHeader}"	"include/ITADualCTC.h" "include/ITADualCTCStreamFilter.h" )
	set( ITACTCSources "${ITACTCSources}" "src/ITADualCTC.cpp" "src/ITADualCTCStreamFilter.cpp" )
endif( ITA_CTC_WITH_DUAL_CTC )
if( ITA_CTC_WITH_N_CTC )
	set( ITACTCHeader "${ITACTCHeader}"	"include/ITANCTC.h" "include/ITANCTCStreamFilter.h" )
	set( ITACTCSources "${ITACTCSources}" "src/ITANCTC.cpp" "src/ITANCTCStreamFilter.cpp" )
endif( ITA_CTC_WITH_N_CTC )
if( ITA_CTC_WITH_QUAD_CTC )
	set( ITACTCHeader "${ITACTCHeader}"	"include/ITAQuadCTC.h" "include/ITAQuadCTCStreamFilter.h" )
	set( ITACTCSources "${ITACTCSources}" "src/ITAQuadCTC.cpp" "src/ITAQuadCTCStreamFilter.cpp" )
endif( ITA_CTC_WITH_QUAD_CTC )

64
65
66
67
if( ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )
	add_definitions( -DNCTC_EXPORT_FILTER_TO_HARDDRIVE )
endif( ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )

Jonas Stienen's avatar
Jonas Stienen committed
68

69
70
71
72
# compiler settings
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_CTC_EXPORT )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
73
	add_definitions( -DITA_FFT_STATIC -DITA_BASE_STATIC -DITA_CONVOLUTION_STATIC -DITA_CTC_STATIC )
74
75
76
77
78
	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 )
79
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
Jonas Stienen's avatar
Jonas Stienen committed
80
81
82


# linker
83
add_library( ITACTC ${ITACTCHeader} ${ITACTCSources} )
Jonas Stienen's avatar
Jonas Stienen committed
84
85
target_link_libraries( ITACTC ${VISTA_USE_PACKAGE_LIBRARIES} )

86
87
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )

Jonas Stienen's avatar
Jonas Stienen committed
88
89
90
91
92
93
94
95
96
97
98
99
100
101

# configure
vista_configure_lib( ITACTC )
vista_install( ITACTC )
set( ITACTC_INCLUDE_OUTDIR "${CMAKE_CURRENT_SOURCE_DIR}/include" )
vista_create_cmake_configs( ITACTC )
vista_create_default_info_file( ITACTC )

set_property( TARGET ITACTC PROPERTY FOLDER "ITACoreLibs" )


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