Improving build and deploy structure, still no automatic itaVA matlab class install

parent cff8070f
......@@ -20,20 +20,26 @@ 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 )
if( NOT DEFINED ITA_MATLAB_DEPLOY_MATLAB_EXECUTABLE )
set( ITA_MATLAB_DEPLOY_MATLAB_EXECUTABLE ON CACHE BOOL "Install VAMatlab executable into deploy binary directory" )
endif( )
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( VANet REQUIRED FIND_DEPENDENCIES )
vista_use_package( Matlab REQUIRED FIND_DEPENDENCIES )
vista_use_package( NatNetSDK REQUIRED FIND_DEPENDENCIES )
# 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 )
# Build settings
if( ITA_CORE_LIBS_STATIC )
add_definitions( -DITACORELIBS_STATIC )
endif( )
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTACORELIBS_STATIC )
add_definitions( -DVISTA_STATIC )
if( WIN32 )
list( APPEND VISTA_USE_PACKAGE_LIBRARIES ws2_32 winspool )
endif( )
endif( )
if( NOT BUILD_SHARED_LIBS )
......@@ -49,7 +55,7 @@ endif( )
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" )
add_definitions( -DVAMATLAB_SHOW_BANNER )
endif( )
......@@ -79,13 +85,10 @@ vista_create_cmake_configs( VAMatlab )
set_property( TARGET VAMatlab PROPERTY FOLDER "VA/Bindings" )
set_target_properties( VAMatlab PROPERTIES SUFFIX ".${MATLAB_MEX_EXTENSION}")
# Build Matlab class and move Matlab executable to bin folder (future work)
if( ITA_VA_MATLAB_POSTBUILD_CREATE_MATLAB_CLASS )
set( MATLAB_BUILD_CLASS_COMMAND "matlab -nodisplay -nosplash -nodesktop -r \"run( 'matlab/itaVA_build_absolute.m' )\"" )
add_custom_command( TARGET VAMatlab POST_BUILD COMMAND ${MATLAB_BUILD_CLASS_COMMAND} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Running matlab itaVA installer" VERBATIM )
if( ITA_MATLAB_DEPLOY_MATLAB_EXECUTABLE )
install( FILES "${CMAKE_BINARY_DIR}/lib/VAMatlab.${MATLAB_MEX_EXTENSION}" DESTINATION "bin" )
endif( )
# VA matlab scripts file
set( VAMATLAB_BASE_DIR "${CMAKE_INSTALL_PREFIX}" )
configure_file( "matlab/itaVA_build.m.proto" "${CMAKE_CURRENT_SOURCE_DIR}/matlab/itaVA_build_absolute.m" @ONLY )
......@@ -98,3 +101,9 @@ install( FILES "matlab/itaVA.m.proto" DESTINATION "matlab" )
install( FILES "matlab/itaVA_generateStubs.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA_example_simple.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA_example_tracked_listener.m" DESTINATION "matlab" )
# Build Matlab class using Matlab (future work)
if( ITA_VA_MATLAB_POSTBUILD_CREATE_MATLAB_CLASS )
set( MATLAB_BUILD_CLASS_COMMAND "matlab -nodisplay -nosplash -nodesktop -r \"run( 'matlab/itaVA_build_absolute.m' )\"" )
add_custom_command( TARGET VAMatlab POST_BUILD COMMAND ${MATLAB_BUILD_CLASS_COMMAND} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Running matlab itaVA installer" VERBATIM )
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