This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4dfd35
commit ffcdb98
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
%% startup_Mex.m | ||
% Run this script only once to permanently add the required folders for using mexWholebodymodel toolbox to your | ||
% MATLAB path. | ||
|
||
fprintf('\nmexWholeBodyModel Toolbox\n'); | ||
|
||
installDir = '@CMAKE_BINARY_DIR@/install'; | ||
mexDir = [installDir, filesep, 'mex']; | ||
mexWrapDir = [mexDir, filesep, 'mexwbi-wrappers']; | ||
mexUtDir = [mexDir, filesep, 'mexwbi-utilities']; | ||
|
||
if exist(mexDir, 'dir') | ||
addpath(mexDir); | ||
end | ||
|
||
if exist(mexUtDir, 'dir') | ||
addpath(mexDir); | ||
end | ||
|
||
if exist(mexWrapDir, 'dir') | ||
addpath(mexDir); | ||
end | ||
|
||
fileDir = userpath; | ||
pathSeparatorLocation = strfind(fileDir, pathsep); | ||
|
||
if isempty(fileDir) | ||
error('Empty userpath. Please set the userpath before running this script'); | ||
elseif size(pathSeparatorLocation, 2) > 1 | ||
error('Multiple userpaths. Please set a single userpath before running this script'); | ||
end | ||
|
||
if (~isempty(pathSeparatorLocation)) | ||
fileDir(pathSeparatorLocation) = []; | ||
end | ||
|
||
fprintf('Saving paths to %s\n\n', [fileDir, filesep, 'pathdef.m']); | ||
|
||
if (~savepath([fileDir, filesep, 'pathdef.m'])) | ||
fprintf(['A file called pathdef.m has been created in your %s folder.\n', ... | ||
'This should be enough to permanentely add all the Mex-Toolbox to ', ... | ||
'your MATLAB installation.\n'], fileDir); | ||
else | ||
disp('There was an error generating pathdef.m To proceed please manually add the contents of variables mexDir, mexUtDir, mexWrapDir to your matlabpath'); | ||
end |