diff --git a/+iri2016/cmake.m b/+iri2016/cmake.m index 5d0821b..7c5abee 100644 --- a/+iri2016/cmake.m +++ b/+iri2016/cmake.m @@ -4,6 +4,8 @@ function cmake(srcdir) srcdir (1,1) string end +fix_macos() + cmd = "cmake --version"; ret = system(cmd); if ret ~= 0 @@ -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