singe/thirdparty/manymouse/contrib/matlab/compile_manymouse_mex.m
2023-10-23 19:38:18 -05:00

40 lines
1.2 KiB
Matlab
Executable file

function compile_manymouse_mex
if isOctave()
% The file 'mkoctfile' (/usr/bin/mkoctfile on Ubuntu 12.04) should have these flags added to CXXFLAGS:
% -std=c++0x -fpermissive -fPIC -DNDEBUG
% While Matlab allows to add these flags when calling mex() (see below) , Octave doesn't ...
mex( '-I../..', '-lX11', '-ldl', ...
'manymouse_mex.cpp', ...
'../../manymouse.c', ...
'../../linux_evdev.c', ...
'../../macosx_hidmanager.c', ...
'../../macosx_hidutilities.c', ...
'../../windows_wminput.c', ...
'../../x11_xinput2.c' );
else
mex( '-I../..', '-lX11', '-ldl', 'CXXFLAGS=$CXXFLAGS -std=c++0x -fpermissive -fPIC -DNDEBUG', ...
'manymouse_mex.cpp', ...
'../../manymouse.c', ...
'../../linux_evdev.c', ...
'../../macosx_hidmanager.c', ...
'../../macosx_hidutilities.c', ...
'../../windows_wminput.c', ...
'../../x11_xinput2.c' );
end
end
function isOct = isOctave()
v = ver;
ret = strcmpi(v(1).Name,'Octave');
if ret
isOct = true;
else
isOct = false;
end
end