Commit 89a921df authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Improving deploy in CMake (adding common files and scripts)

parent 1d2f61d6
# $Id:$
cmake_minimum_required( VERSION 2.8 )
project( VACore )
......@@ -10,23 +8,31 @@ include( VistaCommon )
if( NOT DEFINED ITA_VACORE_WITH_TESTS )
set( ITA_VACORE_WITH_TESTS OFF CACHE BOOL "Build VACore with tests" )
endif( NOT DEFINED ITA_VACORE_WITH_TESTS )
endif( )
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 )
endif( )
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 )
endif( )
if( NOT DEFINED ITA_VA_BUILD_STATIC )
set( ITA_VA_BUILD_STATIC OFF CACHE BOOL "Build static VA libs" )
endif( NOT DEFINED ITA_VA_BUILD_STATIC )
endif( )
if( NOT DEFINED ITA_VACORE_DEPLOY_WITH_COMMON_DATA )
set( ITA_VACORE_DEPLOY_WITH_COMMON_DATA ON CACHE BOOL "Will deploy VACore with common data (HRIR, Directivity, WAV file, HPEQ, Room Model, etc)" )
endif( )
if( NOT DEFINED ITA_VACORE_DEPLOY_WITH_COMMON_CONFIGS )
set( ITA_VACORE_DEPLOY_WITH_COMMON_CONFIGS ON CACHE BOOL "Will deploy VACore with common configuration files (generic VACore.ini, setups for laboraties)" )
endif( )
if( NOT DEFINED ITA_VACORE_INSTALL_WITH_DLLS )
set( ITA_VACORE_INSTALL_WITH_DLLS ON CACHE BOOL "Install VACore with depending DLLs (use this switch with care)" )
endif( NOT DEFINED ITA_VACORE_INSTALL_WITH_DLLS )
if( NOT DEFINED ITA_VACORE_DEPLOY_WITH_COMMON_SCRIPTS )
set( ITA_VACORE_DEPLOY_WITH_COMMON_SCRIPTS ON CACHE BOOL "Will deploy VACore with common scripts (start VAServer from console)" )
endif( )
# Required packages
......@@ -44,47 +50,47 @@ vista_use_package( SPLINE REQUIRED )
vista_find_package( RavenNet QUIET )
if( NOT DEFINED ITA_VACORE_VERSION_MAJOR )
set( ITA_VACORE_VERSION_MAJOR "v2016" CACHE STRING "VACore version major (usually 'v' and year)" )
endif( NOT DEFINED ITA_VACORE_VERSION_MAJOR )
set( ITA_VACORE_VERSION_MAJOR "v2017" CACHE STRING "VACore version major (usually 'v' and year)" )
endif( )
if( NOT DEFINED ITA_VACORE_VERSION_MINOR )
set( ITA_VACORE_VERSION_MINOR "a" CACHE STRING "VACore version minor (usually a,b,c ...)" )
endif( NOT DEFINED ITA_VACORE_VERSION_MINOR )
endif( )
# Settings
if( NOT DEFINED ITA_VACORE_DEFAULT_CONFIG_FILE_NAME )
set( ITA_VACORE_DEFAULT_CONFIG_FILE_NAME VACore.ini CACHE STRING "Default VACore configuration file name (INI file)" )
endif( NOT DEFINED ITA_VACORE_DEFAULT_CONFIG_FILE_NAME )
endif( )
if( NOT DEFINED ITA_VACORE_DEFAULT_DEBUG_LEVEL )
set( ITA_VACORE_DEFAULT_DEBUG_LEVEL 3 CACHE INT "Default VACore debug level (0-5)" )
endif( NOT DEFINED ITA_VACORE_DEFAULT_DEBUG_LEVEL )
endif( )
if( NOT DEFINED ITA_VACORE_MODULE_INTERFACE_ENABLED )
set( ITA_VACORE_MODULE_INTERFACE_ENABLED ON CACHE BOOL "Build VACore with module interface" )
endif( NOT DEFINED ITA_VACORE_MODULE_INTERFACE_ENABLED )
endif( )
if( NOT DEFINED ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION )
set( ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION ON CACHE BOOL "Throw exception during module call attempt if VACore was build without module interface" )
endif( NOT DEFINED ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION )
endif( )
if( NOT DEFINED ITA_VACORE_EVENTS_ENABLED )
set( ITA_VACORE_EVENTS_ENABLED ON CACHE BOOL "VACore event handling" )
endif( NOT DEFINED ITA_VACORE_EVENTS_ENABLED )
endif( )
if( NOT DEFINED ITA_VACORE_MAX_NUM_SOURCES )
set( ITA_VACORE_MAX_NUM_SOURCES 0 CACHE INT "VACore maximum number of sound sources ( 0 = unlimited )" )
endif( NOT DEFINED ITA_VACORE_MAX_NUM_SOURCES )
endif( )
if( NOT DEFINED ITA_VACORE_MAX_NUM_LISTENERS )
set( ITA_VACORE_MAX_NUM_LISTENERS 0 CACHE INT "VACore maximum number of listeners ( 0 = unlimited )" )
endif( NOT DEFINED ITA_VACORE_MAX_NUM_LISTENERS )
endif( )
# Data dirs
if( NOT DEFINED ITA_VACORE_BIG_DATA_DIR )
set( ITA_VACORE_BIG_DATA_DIR "" CACHE PATH "VACore big data dir with more files for auralization (will be added to search path)" )
endif( NOT DEFINED ITA_VACORE_BIG_DATA_DIR )
endif( )
if( NOT DEFINED INSIDE_SCENE_DATA )
set( INSIDE_SCENE_DATA "" CACHE PATH "InsideSceneData folder for Inside scenes" )
endif( NOT DEFINED INSIDE_SCENE_DATA )
endif( )
# drivers
......@@ -102,7 +108,7 @@ endif( )
# Development
if( NOT DEFINED ITA_VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING )
set( ITA_VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING ON CACHE BOOL "Crosstalk-Cancellation sweet spot widening (development)" )
endif( NOT DEFINED ITA_VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING )
endif( )
......@@ -110,67 +116,67 @@ endif( NOT DEFINED ITA_VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER )
set( ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER ON CACHE BOOL "Build VACore with rendering module: ambient mixer" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBISONICS_FREE_FIELD )
set( ITA_VACORE_WITH_RENDERER_AMBISONICS_FREE_FIELD ON CACHE BOOL "Build VACore with rendering module: ambisonics free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_AMBISONICS_FREE_FIELD )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_FREE_FIELD )
set( ITA_VACORE_WITH_RENDERER_BINAURAL_FREE_FIELD ON CACHE BOOL "Build VACore with rendering module: binaural free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_FREE_FIELD )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB )
set( ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB ON CACHE BOOL "Build VACore with rendering module: artificial reverb" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS )
set( ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS OFF CACHE BOOL "Build VACore with rendering module: room acoustics (RAVEN)" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE )
set( ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE ON CACHE BOOL "Build VACore with rendering module: air traffic noise (VATSS)" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_MONAURAL_FREE_FIELD )
set( ITA_VACORE_WITH_RENDERER_MONAURAL_FREE_FIELD ON CACHE BOOL "Build VACore with rendering module: monaural free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_MONAURAL_FREE_FIELD )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY )
set( ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY OFF CACHE BOOL "Build VACore with rendering module: prototype dummy" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID )
set( ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID OFF CACHE BOOL "Build VACore with rendering module: prototype hearing aid (iCARE)" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH )
set( ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH ON CACHE BOOL "Build VACore with rendering module: prototype generic path" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_RENDERER_VBAP_FREE_FIELD )
set( ITA_VACORE_WITH_RENDERER_VBAP_FREE_FIELD OFF CACHE BOOL "Build VACore with rendering module: vector-base amplitude panning free-field" )
endif( NOT DEFINED ITA_VACORE_WITH_RENDERER_VBAP_FREE_FIELD )
endif( )
# Reproduction modules
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH )
set( ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH ON CACHE BOOL "Build VACore with reproduction module: talkthrough" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_HEADPHONES )
set( ITA_VACORE_WITH_REPRODUCTION_HEADPHONES ON CACHE BOOL "Build VACore with reproduction module: headphones (equalization)" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_HEADPHONES )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS )
set( ITA_VACORE_WITH_REPRODUCTION_AMBISONICS OFF CACHE BOOL "Build VACore with reproduction module: ambisonics (B-format decoder)" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC )
set( ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC ON CACHE BOOL "Build VACore with reproduction module: binaural N-CTC" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN )
set( ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN OFF CACHE BOOL "Build VACore with reproduction module: binaural mixdown" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN )
set( ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN OFF CACHE BOOL "Build VACore with reproduction module: ambisonics binaural mixdown (B-format decoder)" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_MIXER_LOW_FREQUENCY )
set( ITA_VACORE_WITH_REPRODUCTION_MIXER_LOW_FREQUENCY ON CACHE BOOL "Build VACore with reproduction module: low frequency (subwoofer) mixer" )
endif( NOT DEFINED ITA_VACORE_WITH_REPRODUCTION_MIXER_LOW_FREQUENCY )
endif( )
......@@ -211,13 +217,13 @@ add_definitions( "-DVACORE_VERSION_MINOR=\"${ITA_VACORE_VERSION_MINOR}\"" )
if( ${ITA_VACORE_MODULE_INTERFACE_ENABLED} )
add_definitions( "-DVACORE_MODULE_INTERFACE_ENABLED=1" )
endif()
endif( )
if( ${ITA_VACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION} )
add_definitions( "-DVACORE_NO_MODULE_INTERFACE_THROW_EXCEPTION=1" )
endif()
endif( )
if( ${ITA_VACORE_EVENTS_ENABLED} )
add_definitions( "-DVACORE_EVENTS_ENABLED=1" )
endif()
endif( )
add_definitions( "-DVACORE_DEFAULT_CONFIGFILE=\"${ITA_VACORE_DEFAULT_CONFIG_FILE_NAME}\"" )
add_definitions( "-DVACORE_MAX_NUM_SOURCES=${ITA_VACORE_MAX_NUM_SOURCES}" )
......@@ -236,16 +242,16 @@ endif( )
# Rendering definitions
if( ${ITA_VACORE_WITH_RENDERER_AMBIENT_MIXER} )
add_definitions( "-DVACORE_WITH_RENDERER_AMBIENT_MIXER=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_AMBISONICS_FREE_FIELD} )
add_definitions( "-DVACORE_WITH_RENDERER_AMBISONICS_FREE_FIELD=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_FREE_FIELD} )
add_definitions( "-DVACORE_WITH_RENDERER_BINAURAL_FREE_FIELD=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB} )
add_definitions( "-DVACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS} )
if( RAVENNET_FOUND )
vista_use_package( RavenNet REQUIRED FIND_DEPENDENCIES )
......@@ -253,48 +259,48 @@ if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS} )
else( RAVENNET_FOUND )
message( "Could not find RavenNet, which is required by binaural room acoustics audio renderer" )
endif( RAVENNET_FOUND )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE} )
add_definitions( "-DVACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_MONAURAL_FREE_FIELD} )
add_definitions( "-DVACORE_WITH_RENDERER_MONAURAL_FREE_FIELD=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_PROTOTYPE_DUMMY} )
add_definitions( "-DVACORE_WITH_RENDERER_PROTOTYPE_DUMMY=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID} )
add_definitions( "-DVACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH} )
add_definitions( "-DVACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_RENDERER_VBAP_FREE_FIELD} )
add_definitions( "-DVACORE_WITH_RENDERER_VBAP_FREE_FIELD=1" )
endif()
endif( )
# Reproduction definitions
if( ${ITA_VACORE_WITH_REPRODUCTION_TALKTHROUGH} )
add_definitions( "-DVACORE_WITH_REPRODUCTION_TALKTHROUGH=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_REPRODUCTION_HEADPHONES} )
add_definitions( "-DVACORE_WITH_REPRODUCTION_HEADPHONES=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_REPRODUCTION_AMBISONICS} )
add_definitions( "-DVACORE_WITH_REPRODUCTION_AMBISONICS=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_REPRODUCTION_BINAURAL_NCTC} )
add_definitions( "-DVACORE_WITH_REPRODUCTION_BINAURAL_NCTC=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN} )
add_definitions( "-DVACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN} )
add_definitions( "-DVACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN=1" )
endif()
endif( )
if( ${ITA_VACORE_WITH_REPRODUCTION_MIXER_LOW_FREQUENCY} )
add_definitions( "-DVACORE_WITH_REPRODUCTION_MIXER_LOW_FREQUENCY=1" )
endif()
endif( )
string( TIMESTAMP VACORE_CMAKE_DATE "%Y-%m-%d" )
add_definitions( "-DVACORE_CMAKE_DATE=\"${VACORE_CMAKE_DATE}\"" )
......@@ -302,12 +308,13 @@ add_definitions( "-DVACORE_CMAKE_DATE=\"${VACORE_CMAKE_DATE}\"" )
# Dev switches
if( ITA_VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING )
add_definitions( "-DVACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING" )
endif( ITA_VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING )
endif( )
# Files
vista_add_files_to_sources( ProjectSources "conf" NON_RECURSIVE SOURCE_GROUP "conf" "ini" )
vista_add_files_to_sources( ProjectSources "data" SOURCE_GROUP_MIRROR_DIR "data" "wav" "daff" "mat" "ac" "skp" )
add_library( VACore ${ProjectSources} )
target_link_libraries( VACore ${VISTA_USE_PACKAGE_LIBRARIES} ) # contains all libraries from vista_use_package() calls
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )
......@@ -321,17 +328,29 @@ vista_create_default_info_file( VACore )
set_property( TARGET VACore PROPERTY FOLDER "VA" )
if( ITA_VACORE_INSTALL_WITH_DLLS OR ITA_VA_INSTALL_WITH_DLLS )
vista_install_all_dlls( bin )
endif()
# VA core configuration file
configure_file( "conf/VACore.ini.proto" "${CMAKE_CURRENT_SOURCE_DIR}/conf/${ITA_VACORE_DEFAULT_CONFIG_FILE_NAME}" @ONLY )
# deploy
if( ITA_VACORE_DEPLOY_WITH_COMMON_DATA )
install( DIRECTORY "data" DESTINATION "." )
endif( )
if( ITA_VACORE_DEPLOY_WITH_COMMON_CONFIGS )
install( DIRECTORY "conf" DESTINATION "." FILES_MATCHING PATTERN "*.ini" )
endif( )
if( ITA_VACORE_DEPLOY_WITH_COMMON_SCRIPTS )
if( WIN32 )
install( FILES "scripts/run_VAServer.bat" DESTINATION "." )
else( )
install( FILES "scripts/run_VAServer.sh" DESTINATION "." )
endif( )
endif( )
# tests
if( ITA_VA_WITH_TESTS OR ITA_VACORE_WITH_TESTS )
set( VACORE_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif()
endif( )
@rem Example how to start the VA server (with configuration file)
bin\VAServer.exe localhost:12340 conf\VACore.ini
\ No newline at end of file
# Example how to start the VA server (with configuration file)
./bin/VAServer localhost:12340 ./conf/VACore.ini
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment