-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.m
42 lines (36 loc) · 996 Bytes
/
build.m
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% @file build.m
% @brief build the matleap mex module
% @author Jeff Perry <[email protected]>
% @version 1.0
% @date 2013-09-12
%stop any running mex files
clear mex %%%%%%%%%%%%%%%%%%%%%%%%%%not sure why this is necessary...need to fix something
% check for sdk
if exist('LeapSDK')~=7
error('The "LeapSDK" folder cannot be found. A link with this name should point to the directory that contains the SDK.');
end
% determine where the Leap library is located
if ismac
libdir_switch='-L./LeapSDK/lib';
elseif isunix || ispc
% check register size
if findstr('64',mexext)
libdir_switch='-L./LeapSDK/lib/x64';
else
libdir_switch='-L./LeapSDK/lib/x86';
end
else
error('Unknown operating system');
end
% create the mex command line
fn='leap2matlab.cpp';
fprintf('Compiling %s\n',fn);
cmd=['mex',...
' -I./LeapSDK/include ',...
libdir_switch,...
' -lLeap ',...
fn];
fprintf('Evaluating "%s"\n',cmd)
% run mex
eval(cmd)
fprintf('Done\n')