function buildcv(src)
ARC = 'x64';
BIN_PATH = ['D:\libs\cv\2.4.10\', ARC ,'\vc12.0\bin'];
INC_OPT = '-ID:\libs\cv\2.4.10\include\opencv ';
INC_OPT = [INC_OPT, '-ID:\libs\cv\2.4.10\include '];
LIB_PATH = ['D:\libs\cv\2.4.10\', ARC ,'\vc12.0\lib'];
LIBS = ' ';
LIBS_ORG = dir([LIB_PATH, '\*.lib']);
for i = 1:numel(LIBS_ORG)
CUR_LIB = strtrim(LIBS_ORG(i).name);
if (CUR_LIB(end-4)~='d')
LIBS = [LIBS, '-l', CUR_LIB, ' '];
end
end
LIB_OPT = ['-L', LIB_PATH, ' ', LIBS];
% Add boost support
INC_OPT = [INC_OPT, ' ', '-ID:\libs\boost\1.57.0 '];
LIB_OPT = [LIB_OPT, ' ', '-LD:\libs\boost\1.57.0\stage\vs12.0\', ARC, ' '];
compile_cmd = ['mex -v -O ', INC_OPT, LIB_OPT, src];
eval(compile_cmd);
PATH_STR = getenv('PATH');
if (numel(strfind(PATH_STR, 'cv'))==0)
setenv('PATH', [BIN_PATH, ';', PATH_STR]);
end
end