Aufgrund einer Wartung wird GitLab am 26.10. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 26.10. between 8:00 and 9:00 am.

Commit 29503a82 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Fixing problems with itaVA matlab build script

parent e7f1897d
% Code generator for the VA Matlab interface facade class
% Desc: This script generates the code for the Matlab
% facade class to the VAInterface MEXExtension.
% It takes the class template code and inserts
% all stubs for the functions in the VAConnector
% interface. These are derived using the reflexion
% mechanism ('enumerateFunctions')
script_dir = 'C:/dev/VA/dist/VA.v2017b_win32-x64.vc12/matlab'; % Matlab scripts target directory
deploy_dir = 'C:/dev/VA/dist/VA.v2017b_win32-x64.vc12/bin'; % Deploy directory, i.e. 'C:/dev/VA/dist/win32-x64.vc12'
lib_dir = 'C:/dev/VA/dist/VA.v2017b_win32-x64.vc12/lib';
if exist( deploy_dir, 'dir' ) ~= 7
error( 'Deploy dir ''%s'' does not exist. Please build and install VAMatlab first.', deploy_dir )
if exist( script_dir, 'dir' ) ~= 7
mkdir( script_dir );
if exist( [ 'VAMatlab' mexext ], 'file' )
warning( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) )
% Add to PATH temporarily and attempt to move lib to bin dir
addpath( script_dir, deploy_dir )
[ s ] = movefile( fullfile( lib_dir, 'VAMatlab*' ), deploy_dir );
if ~s && ~exist( [ 'VAMatlab' '.' mexext ], 'file' )
error( 'Could locate VAMatlab executable. Please make sure that it can be found.' )
% Parameters
templateFile = 'itaVA.m.proto';
outputFile = fullfile( script_dir, 'itaVA.m' );
fprintf( 'Generating code for itaVA Matlab class ''%s'' ...\n', outputFile );
code = fileread( templateFile );
stubCode = itaVA_generateStubs();
code = strrep( code, '###STUBCODE###', stubCode );
% Write the results
fid = fopen( outputFile, 'w' );
fprintf( fid, '%s', code );
fclose( fid );
fprintf( 'Matlab class ''%s'' successfully built\n', outputFile );
% Install examples
copyfile( 'itaVA_example*', script_dir );
% Remove from MATLABPATH (otherwise naming conflicts may occur with
% ITA-Toolbox/applications/VirtualAcoustics/VA/* scripts)
rmpath( script_dir, deploy_dir )
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