mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fixed incorrect mex file name being shown in the generated class code.
This commit is contained in:
parent
b85cb68e79
commit
bcf98e05ed
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.4)
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
|
|
||||||
PROJECT(mex_functions)
|
PROJECT(mex_functions)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# that additional library dependencies can be added like this: add_mex_function(name lib1 dlib libetc).
|
# that additional library dependencies can be added like this: add_mex_function(name lib1 dlib libetc).
|
||||||
# That is, just add more libraries after the name and they will be build into the mex file.
|
# That is, just add more libraries after the name and they will be build into the mex file.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.4)
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
|
|
||||||
set(BUILDING_MATLAB_MEX_FILE true)
|
set(BUILDING_MATLAB_MEX_FILE true)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE True)
|
set(CMAKE_POSITION_INDEPENDENT_CODE True)
|
||||||
@ -69,6 +69,7 @@ INCLUDE(InstallRequiredSystemLibraries)
|
|||||||
|
|
||||||
MACRO(add_mex_function name )
|
MACRO(add_mex_function name )
|
||||||
ADD_LIBRARY(${name} MODULE ${name}.cpp )
|
ADD_LIBRARY(${name} MODULE ${name}.cpp )
|
||||||
|
target_compile_definitions(${name} PRIVATE -DMEX_FILENAME=${name})
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
# Doing this prevents our mex function from exporting any symbols
|
# Doing this prevents our mex function from exporting any symbols
|
||||||
# other than mexFunction(). This sometimes doesn't matter but sometimes
|
# other than mexFunction(). This sometimes doesn't matter but sometimes
|
||||||
|
@ -4897,7 +4897,7 @@ void mexFunction( int nlhs, mxArray *plhs[],
|
|||||||
string classname = trim(string(DEF2STR(MEX_CLASS_NAME)), " \t()");
|
string classname = trim(string(DEF2STR(MEX_CLASS_NAME)), " \t()");
|
||||||
std::vector<string> methods = split(trim(string(DEF2STR(MEX_CLASS_METHODS)), " \t()"), " \t,");
|
std::vector<string> methods = split(trim(string(DEF2STR(MEX_CLASS_METHODS)), " \t()"), " \t,");
|
||||||
|
|
||||||
string mex_filename = "mex_"+classname;
|
string mex_filename = trim(string(DEF2STR(MEX_FILENAME))," \t()");
|
||||||
bool has_load_obj = false;
|
bool has_load_obj = false;
|
||||||
size_t load_obj_idx = 0;
|
size_t load_obj_idx = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user