Commit 573fce15 authored by Davis King's avatar Davis King

Improved building of mex files with cmake.

parent 37c1055a
......@@ -107,7 +107,11 @@ if (UNIX)
INCLUDE (CheckFunctionExists)
if (NOT blas_found)
find_library(cblas_lib openblas PATHS ${extra_paths})
if (BUILDING_MATLAB_MEX_FILE)
find_library(cblas_lib libopenblas.a PATHS ${extra_paths})
else()
find_library(cblas_lib openblas PATHS ${extra_paths})
endif()
if (cblas_lib)
set(blas_libraries ${cblas_lib})
set(blas_found 1)
......
......@@ -67,6 +67,14 @@ INCLUDE(InstallRequiredSystemLibraries)
MACRO(add_mex_function name )
ADD_LIBRARY(${name} MODULE ${name}.cpp )
if (UNIX)
if (DEFINED ENV{MATLAB_HOME})
set_target_properties(${name} PROPERTIES LINK_FLAGS "-Wl,--version-script,$ENV{MATLAB_HOME}/extern/lib/glnxa64/mexFunction.map")
else()
set_target_properties(${name} PROPERTIES LINK_FLAGS "-Wl,--version-script,${MATLAB_HOME}/extern/lib/glnxa64/mexFunction.map")
endif()
endif()
# Change the output file extension to a mex extension.
if (WIN32)
set_target_properties(${name} PROPERTIES SUFFIX ".mexw64")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment