CMakeLists.txt 2.61 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( ITASampler )

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

# dependencies
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )


13 14 15 16
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 )

17 18 19 20
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 )

Jonas Stienen's avatar
Jonas Stienen committed
21 22 23 24 25 26 27 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
# includes
include_directories( "include" )


# sources
set( ITASamplerHeader
	"include/ITASampleClock.h"
	"include/ITASamplerDefinition.h"
	"include/ITASoundSample.h"
	"include/ITASoundSamplePool.h"
	"include/ITASoundSampler.h"
	)
set( ITASamplerSources
	"src/ITASoundSampler.cpp"
	"src/ITASoundSampleImpl.cpp"
	"src/ITASoundSampleImpl.h"
	"src/ITASoundSamplePool.cpp"
	"src/ITASoundSamplePoolImpl.cpp"
	"src/ITASoundSamplePoolImpl.h"
	"src/ITASoundSamplerImpl.h"
	"src/ITASoundSamplerImpl.cpp"
	"src/ITASoundSamplerImpl.h"
	"src/ITASoundSamplerImpl.cpp"
	"src/ITASoundSamplerPlayback.h"
	"src/ITASoundSamplerSlot.h"
	"src/ITASoundSamplerSlotbuffer.h"
	"src/ITASoundSamplerSlotbuffer.cpp"
	"src/PlaybackIDGenerator.cpp"
	"src/PlaybackIDGenerator.h"
	)


53 54 55 56 57
# compiler settings
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_SAMPLER_EXPORT )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_BASE_STATIC -ITA_DATA_SOURCES_STATIC -DITA_SAMPLER_STATIC )
58 59 60 61 62
	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 )
63
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
64 65 66
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( ITA_VISTA_BUILD_STATIC )
Jonas Stienen's avatar
Jonas Stienen committed
67 68 69


# linker
70
add_library( ITASampler ${ITASamplerHeader} ${ITASamplerSources} )
Jonas Stienen's avatar
Jonas Stienen committed
71 72
target_link_libraries( ITASampler ${VISTA_USE_PACKAGE_LIBRARIES} )

73 74
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )

Jonas Stienen's avatar
Jonas Stienen committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88

# config
vista_configure_lib( ITASampler )
vista_install( ITASampler )
set( ITASAMPLER_INCLUDE_OUTDIR "${CMAKE_CURRENT_SOURCE_DIR}/include" )
vista_create_cmake_configs( ITASampler )
vista_create_default_info_file( ITASampler )

set_property( TARGET ITASampler PROPERTY FOLDER "ITACoreLibs" )

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