mirror of https://github.com/davisking/dlib.git
detect file extension of mex function
This commit is contained in:
parent
30ba39c9ad
commit
18711b55a8
|
@ -70,7 +70,14 @@ INCLUDE(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
|
|
||||||
MACRO(add_mex_function name )
|
MACRO(add_mex_function name )
|
||||||
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.C")
|
||||||
|
ADD_LIBRARY(${name} MODULE ${name}.C)
|
||||||
|
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.c")
|
||||||
|
ADD_LIBRARY(${name} MODULE ${name}.c)
|
||||||
|
else()
|
||||||
ADD_LIBRARY(${name} MODULE ${name}.cpp )
|
ADD_LIBRARY(${name} MODULE ${name}.cpp )
|
||||||
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(${name} PRIVATE -DMEX_FILENAME=${name})
|
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
|
||||||
|
|
Loading…
Reference in New Issue