Better proto for building itaVA

parent f452d430
......@@ -13,18 +13,9 @@
%
% Clear everything first, so that no inconsistens
% class instances can exist (we have to use
% class instances can exist
clear all
if exist( 'VAMatlab', 'var' )
warn( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) )
else
if isdir( '../dist/win32-x64.vc12/bin' )
addpath( '../dist/win32-x64.vc12/bin' )
addpath( '../dist/win32-x64.vc12/lib' )
end
end
% Uncomment the path you are building your matlab executable against. It is
% sufficient to execute this once for a matlab session. It is always recommended
% to build against a release executable, use debug mode only if you actually
......@@ -32,16 +23,27 @@ end
% link the executable against a Matlab version/platform that is not installed
% on your machine.
script_dir = './';
deploy_dir = './';
script_dir = '@VAMATLAB_SCRIPT_DIR@';
deploy_dir = '@VAMATLAB_DEPLOY_DIR@';
lib_dir = '@VAMATLAB_LIB_DIR@';
if exist( deploy_dir, 'dir' ) ~= 7
error( 'Deploy dir ''%s'' does not exist. Please build and install VAMatlab first.', deploy_dir )
end
% Add to MATLABPATH temporarily
addpath( script_dir )
addpath( deploy_dir )
if exist( 'VAMatlab', 'file' )
warning( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) )
else
% Add to PATH temporarily
addpath( script_dir, deploy_dir, lib_dir )
end
% Parameters
templateFile = 'itaVA.proto.m';
outputFile = fullfile( script_dir, 'itaVA.m' );
if exist( script_dir, 'dir' ) ~= 7
mkdir( script_dir );
end
fprintf( 'Generating code for itaVA Matlab class ''%s'' ...\n', outputFile );
code = fileread( templateFile );
......@@ -54,9 +56,8 @@ fid = fopen( outputFile, 'w' );
fprintf( fid, '%s', code );
fclose( fid );
fprintf('Matlab class ''%s'' successfully built\n', outputFile);
fprintf( 'Matlab class ''%s'' successfully built\n', outputFile );
% Remove from MATLABPATH (otherwise naming conflicts may occur with
% ITA-Toolbox/applications/VA/*)
rmpath( script_dir )
rmpath( deploy_dir )
% ITA-Toolbox/applications/VirtualAcoustics/VA/* scripts)
rmpath( script_dir, deploy_dir, lib_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