Simplifying cmake configuration

parent 6385bd9d
cmake_minimum_required( VERSION 2.8 )
if( NOT VA_COMMON_BUILD )
project( VAServer )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
project( VAServer )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( VACore REQUIRED FIND_DEPENDENCIES )
vista_use_package( VANet REQUIRED FIND_DEPENDENCIES )
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 )
if( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
set( ITA_CORE_LIBS_BUILD_STATIC OFF CACHE BOOL "Link against satic ITA core libs" )
endif( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
if( NOT DEFINED ITA_VA_BUILD_STATIC )
set( ITA_VA_BUILD_STATIC OFF CACHE BOOL "Link aginst static VA libs" )
endif( NOT DEFINED ITA_VA_BUILD_STATIC )
if( NOT DEFINED ITA_VASERVER_INSTALL_WITH_DLLS )
set( ITA_VASERVER_INSTALL_WITH_DLLS ON CACHE BOOL "Install VAServer with depending DLLs (use this switch with care)" )
endif( NOT DEFINED ITA_VASERVER_INSTALL_WITH_DLLS )
# compiler
if( ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
endif( ITA_CORE_LIBS_BUILD_STATIC )
endif( )
if( ITA_VA_BUILD_STATIC )
add_definitions( -DVABASE_STATIC -DVACORE_STATIC -DVANET_STATIC )
endif( ITA_VA_BUILD_STATIC )
endif( )
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAINTERPROCCOMM_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAMATH_STATIC )
if( WIN32 )
set( VISTAINTERPROCCOMM_ADDITIONAL_DEPENDENCIES Ws2_32 )
endif( WIN32 )
endif( ITA_VISTA_BUILD_STATIC )
endif( )
endif( )
# linker
add_executable( VAServer VAServer.cpp )
......@@ -55,7 +34,7 @@ target_link_libraries( VAServer ${VISTA_USE_PACKAGE_LIBRARIES} ${VISTAINTERPROCC
set( ITA_VA_VASERVER_CONFIG_PATH "${VACORE_ROOT_DIR}/conf/VACore.ini" )
if( NOT DEFINED ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS )
set( ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS "0.0.0.0:12340 \"${ITA_VA_VASERVER_CONFIG_PATH}\"" CACHE STRING "VAServer command line arguments for execution out of Visual Studio" )
endif( NOT DEFINED ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS )
endif( )
vista_set_target_msvc_arguments( VAServer ${ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS} )
......@@ -65,10 +44,6 @@ vista_create_default_info_file( VAServer )
set_property( TARGET VAServer PROPERTY FOLDER "VA/Apps" )
if( ITA_VASERVER_INSTALL_WITH_DLLS OR ITA_VA_INSTALL_WITH_DLLS )
vista_install_all_dlls( bin )
endif()
# dev
if( MSVC )
......@@ -78,6 +53,6 @@ if( MSVC )
vista_add_external_msvc_project_of_package( VABase "VA" DEPENDENT VAServer SILENT )
vista_add_external_msvc_project_of_package( VACore "VA" DEPENDENT VAServer SILENT )
vista_add_external_msvc_project_of_package( VANet "VA" DEPENDENT VAServer SILENT )
endif()
endif()
endif( )
endif( )
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