CMakeLists.txt 2.99 KB
Newer Older
1 2
cmake_minimum_required( VERSION 2.8 )

3 4 5
project( VAMatlab )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
6 7 8 9 10

if( NOT DEFINED ITA_VA_MATLAB_BUILD_WITH_INTERNAL_CORE )
	set( ITA_VA_MATLAB_BUILD_WITH_INTERNAL_CORE OFF CACHE BOOL "Build a VACore into VAMatlab instead of using a network adapter (not recommended)" )
endif( NOT DEFINED ITA_VA_MATLAB_BUILD_WITH_INTERNAL_CORE )

11
if( NOT DEFINED ITA_VAMATLAB_VERSION_MAJOR )
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
12
	set( ITA_VAMATLAB_VERSION_MAJOR "v2017" CACHE STRING "VAMatlab version major (usually 'v' and year)" )
13 14 15 16 17 18 19 20 21 22
endif( NOT DEFINED ITA_VAMATLAB_VERSION_MAJOR )

if( NOT DEFINED ITA_VAMATLAB_VERSION_MINOR )
	set( ITA_VAMATLAB_VERSION_MINOR "a" CACHE STRING "VAMatlab version minor (usually a,b,c ...)" )
endif( NOT DEFINED ITA_VAMATLAB_VERSION_MINOR )

if( NOT DEFINED ITA_VAMATLAB_SHOW_BANNER )
	set( ITA_VAMATLAB_SHOW_BANNER ON CACHE BOOL "Show VA banner on Matlab init" )
endif( NOT DEFINED ITA_VAMATLAB_SHOW_BANNER )

23 24
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( VANet REQUIRED FIND_DEPENDENCIES )
25 26
vista_use_package( Matlab REQUIRED FIND_DEPENDENCIES )
vista_use_package( NatNetSDK REQUIRED )
27

28 29 30 31

# Compiler
if( ITA_CORE_LIBS_BUILD_STATIC )
	add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC -DITA_DIFFRACTION_STATIC -DITA_GEO_STATIC -DITA_CONVOLUTION_STATIC -DITA_FFT_STATIC -DITA_CTC_STATIC -DITA_SAMPLER_STATIC )
32
endif( )
33 34 35

if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
36
endif( )
37

38
if( BUILD_SHARED_LIBS )
39
	add_definitions( -DVAMATLAB_EXPORTS )
40
else( )
41
	add_definitions( -DVABASE_STATIC -DVANET_STATIC  )
42
endif( )
43 44 45

if( ITA_VA_MATLAB_BUILD_WITH_INTERNAL_CORE )
	vista_use_package( VACore REQUIRED FIND_DEPENDENCIES )
Dipl.-Ing. Jonas Stienen's avatar
test  
Dipl.-Ing. Jonas Stienen committed
46
	add_definitions( -DVAMATLAB_INTERNAL_CORE )
47
endif( )
48

49 50 51 52
add_definitions( "-DVAMATLAB_VERSION_MAJOR=\"${ITA_VAMATLAB_VERSION_MAJOR}\"" )
add_definitions( "-DVAMATLAB_VERSION_MINOR=\"${ITA_VAMATLAB_VERSION_MINOR}\"" )
if( ITA_VAMATLAB_SHOW_BANNER )
	add_definitions( "-DVAMATLAB_SHOW_BANNER" )
53
endif( )
54 55
	

56
# Sources
57
set( VAMATLAB_SRC
58 59 60 61 62 63 64 65
	"src/FunctionMappings.h"
	"src/MatlabHelpers.h"
	"src/MatlabHelpers.cpp"
	"src/VAMatlabConnection.cpp"
	"src/VAMatlabConnection.h"
	"src/VAMatlabExecutable.cpp"
	"src/VAMatlabTracking.h"
	"src/VAMatlabTracking.cpp" )
66
	
67

68
add_library( VAMatlab ${VAMATLAB_SRC} VAMatlab.def )
69 70
target_link_libraries( VAMatlab ${VISTA_USE_PACKAGE_LIBRARIES} )

71
vista_configure_lib( VAMatlab )
72 73
vista_install( VAMatlab )
vista_create_default_info_file( VAMatlab )
74
vista_create_cmake_configs( VAMatlab )
75

76
set_property( TARGET VAMatlab PROPERTY FOLDER "VA/Bindings" )
77
set_target_properties( VAMatlab PROPERTIES SUFFIX ".${MATLAB_MEX_EXTENSION}")
78

79

80
# VA matlab scripts file
81 82 83 84
set( VAMATLAB_DEPLOY_DIR "${CMAKE_INSTALL_PREFIX}/bin" )
set( VAMATLAB_SCRIPT_DIR "${CMAKE_INSTALL_PREFIX}/matlab" )
set( VAMATLAB_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" )
configure_file( "matlab/itaVA_build.m.proto" "${CMAKE_CURRENT_SOURCE_DIR}/matlab/itaVA_build.m" @ONLY )