Skip to content

Commit

Permalink
matlab: apply macos path fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Sep 30, 2020
1 parent 7442e67 commit 203a7b2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions +iri2016/cmake.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ function cmake(srcdir)
srcdir (1,1) string
end

fix_macos()

cmd = "cmake --version";
ret = system(cmd);
if ret ~= 0
Expand All @@ -17,3 +19,25 @@ function cmake(srcdir)
assert(ret==0, 'failed to build IRI')

end


function fix_macos()

%% MacOS PATH workaround
% Matlab does not seem to load .zshrc or otherwise pickup shell "export" like
% Matlab on Linux or Windows does, so we apply these MacOS-specific workaround
if ~ismac
return
end

sys_path = getenv("PATH");
needed_paths = "/usr/local/bin";
for np = needed_paths
if isfolder(np) && ~contains(sys_path, np)
sys_path = np + pathsep + sys_path;
end
end

setenv('PATH', sys_path)

end % function

0 comments on commit 203a7b2

Please sign in to comment.