% Copyright 2017 The Johns Hopkins University Applied Physics Laboratory.
% Licensed under the MIT License. See LICENSE.txt in the project root for full license information.

%
% Script to build the PCS metric executables.
%
% Assumes compile is happening in pipelinePCS directory.
%
% Version History
%   2017/03/28  Marc Bosch       Initial version
%

%check if files are compiled
if ~(exist(fullfile('mexFiles','mexbuffer2gridC'))== 3)
    addpath(fullfile('mexFiles'))
    mex(fullfile('mexFiles','mexbuffer2gridC.cpp'));
    rmpath(fullfile('mexFiles'))
end
if ~(exist(fullfile('mexFiles','mexDihAngC'))== 3)
    addpath(fullfile('mexFiles'))
    mex(fullfile('mexFiles','mexDihAngC.cpp'));
    rmpath(fullfile('mexFiles'))
end
if ~(exist(fullfile('mexFiles','mexErrorCurvatureMetricsC'))== 3)
    addpath(fullfile('mexFiles'))
    mex(fullfile('mexFiles','mexErrorCurvatureMetricsC.cpp'));
    rmpath(fullfile('mexFiles'))
end
if ~(exist(fullfile('mexFiles','mexErrorGridded3DAccuracyMetricsC'))== 3)
    addpath(fullfile('mexFiles'))
    mex(fullfile('mexFiles','mexErrorGridded3DAccuracyMetricsC.cpp'));
    rmpath(fullfile('mexFiles'))
end
if ~(exist(fullfile('mexFiles','mexfindpointreferenceC'))== 3)
    addpath(fullfile('mexFiles'))
    mex(fullfile('mexFiles','mexfindpointreferenceC.cpp'));
    rmpath(fullfile('mexFiles'))
end
if ~(exist(fullfile('mexFiles','mexGeomLapErrorC'))== 3)
    addpath(fullfile('mexFiles'))
    mex(fullfile('mexFiles','mexGeomLapErrorC.cpp'));
    rmpath(fullfile('mexFiles'))
end