-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.m
39 lines (34 loc) · 873 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
% @file build.m
% @brief build the matleap mex module
% @author Jeff Perry <jeffsp@gmail.com>
% @version 1.0
% @date 2013-09-12
% 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='matleap.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')