File: cygmex.sh

package info (click to toggle)
pfstools 2.2.0-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,548 kB
  • sloc: cpp: 26,364; javascript: 3,814; ansic: 999; sh: 180; python: 65; makefile: 47
file content (28 lines) | stat: -rwxr-xr-x 620 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# This is a script of tricks to compile matlab interface with mex and Visual Studio when executed from cygwin

mexargs=""

for arg in $*; do 
	if [[ $arg == *"/"* ]]; then
		if [[ $arg == "-I"* ]]; then
			conv_arg="-I`cygpath -m ${arg:2}`"
		elif [[ $arg == "-L"* ]]; then
			conv_arg="-L`cygpath -m ${arg:2}`"
		else
			conv_arg=`cygpath -m $arg`
		fi
	else
		conv_arg=$arg
	fi	
	if [[ $conv_arg == *".cpp.o" ]]; then
		conv_arg=`echo ${conv_arg%.cpp.o}.obj | sed 's/__\/pfs//g'`				
	fi
	mexargs="$mexargs $conv_arg"
done

#echo "Running command: @MATLAB_MEX_EXE@ $mexargs"

"@MATLAB_MEX_EXE@" $mexargs