CMakeLists.txt 1.82 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
cmake_minimum_required( VERSION 2.8 )

if( NOT VA_COMMON_BUILD )

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

11 12 13 14 15 16 17 18
if( NOT DEFINED ITA_VA_MATLAB_INSTALL_WITH_DLLS )
	set( ITA_VA_MATLAB_INSTALL_WITH_DLLS ON CACHE BOOL "Install VAMatlab with depending DLLs (use with care)" )
endif( NOT DEFINED ITA_VA_MATLAB_INSTALL_WITH_DLLS )

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 )

19 20
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( VANet REQUIRED FIND_DEPENDENCIES )
21 22
vista_use_package( Matlab REQUIRED FIND_DEPENDENCIES )
vista_use_package( NatNetSDK REQUIRED )
23

24 25 26 27 28 29
add_definitions( -DVABASE_DLL -DVANET_DLL )

if( ITA_VA_MATLAB_BUILD_WITH_INTERNAL_CORE )
	vista_use_package( VACore REQUIRED FIND_DEPENDENCIES )
	add_definitions( -DVACORE_DLL -DVAMATLAB_INTERNAL_CORE )
endif( ITA_VA_MATLAB_BUILD_WITH_INTERNAL_CORE )
30

31
set( VAMATLAB_SRC
32 33 34 35 36 37 38 39 40
	"src/FunctionMappings.h"
	"src/MatlabHelpers.h"
	"src/MatlabHelpers.cpp"
	"src/VAMatlabConnection.cpp"
	"src/VAMatlabConnection.h"
	"src/VAMatlabExecutable.cpp"
	"src/VAMatlabTracking.h"
	"src/VAMatlabTracking.cpp" )

41
add_library( VAMatlab ${VAMATLAB_SRC} VAMatlab.def )
42 43
target_link_libraries( VAMatlab ${VISTA_USE_PACKAGE_LIBRARIES} )

44
vista_configure_lib( VAMatlab )
45 46
vista_install( VAMatlab )
vista_create_default_info_file( VAMatlab )
47
vista_create_cmake_configs( VAMatlab )
48 49

set_property( TARGET VAMatlab PROPERTY FOLDER "ITABindings" )
50
set_target_properties( VAMatlab PROPERTIES SUFFIX ".${MATLAB_MEX_EXTENSION}")
51 52 53 54

if( ITA_VA_MATLAB_INSTALL_WITH_DLLS OR ITA_VA_INSTALL_WITH_DLLS )
	vista_install_all_dlls( bin )
endif()