CMakeLists.txt 1.76 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1 2 3 4
cmake_minimum_required( VERSION 2.8 )
project( VABase )


5 6 7 8 9 10 11 12
# ViSTA CMake build environment
if( EXISTS $ENV{VISTA_CMAKE_COMMON} )
	# VistaCMakeCommon is available, use the ViSTA build environment
	list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
	include( VistaCommon )
else( )
	message( "Could not find VistaCMakeCommon. Only VABase can be build without the ViSTA CMake build environment. See http://www.virtualacoustics.org for help." )
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
13 14 15

include_directories( "include" )

16 17

# preprocessor
18
if( BUILD_SHARED_LIBS )
19
	add_definitions( -DVABASE_EXPORT )
20
else( )
Marco Berzborn's avatar
Marco Berzborn committed
21
    add_definitions( -DVABASE_STATIC )
22
endif( )	
Jonas Stienen's avatar
Jonas Stienen committed
23

24 25 26 27
if( NOT WIN32 )
	add_definitions( -std=gnu++11 )
endif( )

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

# headers and source files
set( VABase_Headers
	"include/VA.h"
	"include/VAAudioSignalSource.h"
	"include/VABase.h"
	"include/VABaseDefinitions.h"
	"include/VAEvent.h"
	"include/VAEventHandlerGlobalLock.h"
	"include/VAException.h"
	"include/VAInterface.h"
	"include/VAObject.h"
	"include/VAObjectRegistry.h"
	"include/VASamples.h"
	"include/VAStruct.h"
	"include/VAVersion.h"
)

set( VABase_Src
	"src/VABase.cpp"
	"src/VAEvent.cpp"
	"src/VAEventHandlerGlobalLock.cpp"
	"src/VAException.cpp"
	"src/VAInterface.cpp"
	"src/VAObject.cpp"
	"src/VAObjectRegistry.cpp"
	"src/VASamples.cpp"
	"src/VAStruct.cpp"
	"src/VAVersion.cpp"
)


60
# linker
61 62
add_library( VABase ${VABase_Headers} ${VABase_Src} )
target_link_libraries( VABase )
Jonas Stienen's avatar
Jonas Stienen committed
63 64 65 66 67 68 69 70 71 72 73 74 75


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

set_property( TARGET VABase PROPERTY FOLDER "VA" )


# tests
76
if( ITA_VA_WITH_TESTS )
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
77
	set( VABASE_COMMON_BUILD TRUE )
78
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
79
endif( )