Permalink
Browse files

make/matlab.mak: fixes error message when MEX is not found

  • Loading branch information...
1 parent 4f3ab48 commit 3cc0ed0edb86bdd0e3397ab18533189c7cd53dbb @vedaldi vedaldi committed Jun 18, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 make/matlab.mak
View
@@ -9,7 +9,8 @@
# the empty string disables MATLAB support.
MEX ?= mex
-MATLAB_PATH ?= $(strip $(shell $(MEX) -v 2>&1 | sed -n 's/.*MATLAB *= *\(.*\)/\1/gp'))
+MATLAB_PATH ?= $(strip $(shell test "$$(command -v '$(MEX)')" && \
+ $(MEX) -v 2>&1 | sed -n 's/.*MATLAB *= *\(.*\)/\1/gp'))
MATLAB_EXE ?= "$(MATLAB_PATH)/bin/matlab"
# if expand to empty string, set to empty string for use with ifdef

0 comments on commit 3cc0ed0

Please sign in to comment.