From 0584696c83fb3bab2d61c7aa18efa123dc00a50b Mon Sep 17 00:00:00 2001 From: Amro Date: Fri, 4 Jan 2013 03:11:29 +0300 Subject: [PATCH] use mexopencv.root instead of hardcoded paths --- +cv/make.m | 2 +- test/UnitTest.m | 7 ++----- utils/MDoc.m | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/+cv/make.m b/+cv/make.m index e3154a443..1553281cc 100644 --- a/+cv/make.m +++ b/+cv/make.m @@ -10,7 +10,7 @@ function make(varargin) % cwd = pwd; -cd(fileparts(fileparts(mfilename('fullpath')))); +cd(mexopencv.root()); if ispc % Windows % Clean diff --git a/test/UnitTest.m b/test/UnitTest.m index 29e14c953..b34018400 100644 --- a/test/UnitTest.m +++ b/test/UnitTest.m @@ -4,17 +4,14 @@ % cd test; % UnitTest; properties (Constant) - ROOT = fileparts(mfilename('fullpath')) - TESTDIR = [UnitTest.ROOT,filesep,'unit_tests'] - BINDIR = [fileparts(UnitTest.ROOT),filesep,'matlab'] + TESTDIR = fullfile(mexopencv.root(),'test','unit_tests'); end methods function obj = UnitTest() %UNITTEST execute all unit tests addpath(UnitTest.TESTDIR); - addpath(fileparts(UnitTest.ROOT)); - d = dir([UnitTest.TESTDIR,filesep,'*.m']); + d = dir(fullfile(UnitTest.TESTDIR,'*.m')); for i = 1:numel(d) class_name = strrep(d(i).name,'.m',''); fprintf('== %s ======\n',class_name); diff --git a/utils/MDoc.m b/utils/MDoc.m index 46e9493f5..c63947a76 100644 --- a/utils/MDoc.m +++ b/utils/MDoc.m @@ -14,7 +14,7 @@ properties (Constant) % Directory to place documentation - DIR = fullfile('doc','matlab') + DIR = fullfile(mexopencv.root(),'doc','matlab') % Default CSS file CSS = fullfile(matlabroot,'toolbox','matlab','helptools',... 'private','helpwin.css') @@ -43,7 +43,7 @@ this.process_index(); % Get a list of functions - list = dir('+cv/*.m'); + list = dir(fullfile(mexopencv.root(),'+cv','*.m')); this.yet = strrep({list.name},'.m',''); while ~isempty(this.yet) fname = this.yet{1};