Minor updates to cmake checks for Octave/Matlab

master
Paul Sutton 10 years ago
parent fe3d723bdd
commit 3e34fae516

@ -24,7 +24,7 @@
# The original file was copied from an Ubuntu Linux install
# /usr/share/cmake-2.8/Modules/FindMatlab.cmake
set(MATLAB_FOUND 0)
set(MATLAB_FOUND FALSE)
if(WIN32)
# Search for a version of Matlab available, starting from the most modern one to older versions
foreach(MATVER "7.14" "7.11" "7.10" "7.9" "7.8" "7.7" "7.6" "7.5" "7.4")
@ -128,25 +128,25 @@ else()
# Get path to the MEX libraries
execute_process(
#COMMAND find "${MATLAB_ROOT}/extern/lib" -name libmex${LIBRARY_EXTENSION} # Peter
COMMAND find "${MATLAB_ROOT}/bin" -name libmex${LIBRARY_EXTENSION} # standard
COMMAND find "${MATLAB_ROOT}/bin" -name libmex${LIBRARY_EXTENSION} # standard
COMMAND xargs echo -n
OUTPUT_VARIABLE MATLAB_MEX_LIBRARY
)
execute_process(
#COMMAND find "${MATLAB_ROOT}/extern/lib" -name libmx${LIBRARY_EXTENSION} # Peter
COMMAND find "${MATLAB_ROOT}/bin" -name libmx${LIBRARY_EXTENSION} # Standard
COMMAND find "${MATLAB_ROOT}/bin" -name libmx${LIBRARY_EXTENSION} # Standard
COMMAND xargs echo -n
OUTPUT_VARIABLE MATLAB_MX_LIBRARY
)
execute_process(
#COMMAND find "${MATLAB_ROOT}/extern/lib" -name libmat${LIBRARY_EXTENSION} # Peter
COMMAND find "${MATLAB_ROOT}/bin" -name libmat${LIBRARY_EXTENSION} # Standard
COMMAND find "${MATLAB_ROOT}/bin" -name libmat${LIBRARY_EXTENSION} # Standard
COMMAND xargs echo -n
OUTPUT_VARIABLE MATLAB_MAT_LIBRARY
)
execute_process(
#COMMAND find "${MATLAB_ROOT}/extern/lib" -name libeng${LIBRARY_EXTENSION} # Peter
COMMAND find "${MATLAB_ROOT}/bin" -name libeng${LIBRARY_EXTENSION} # Standard
COMMAND find "${MATLAB_ROOT}/bin" -name libeng${LIBRARY_EXTENSION} # Standard
COMMAND xargs echo -n
OUTPUT_VARIABLE MATLAB_ENG_LIBRARY
)
@ -185,7 +185,7 @@ set(MATLAB_LIBRARIES
)
if(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
set(MATLAB_FOUND 1)
set(MATLAB_FOUND TRUE)
endif()
# 32-bit or 64-bit mex

@ -37,27 +37,26 @@ if(NOT MATLAB_MEX_PATH)
)
endif()
IF (MATLAB_FOUND)
if(MATLAB_FOUND)
message(STATUS "Found MATLAB in ${MATLAB_ROOT}")
ENDIF(MATLAB_FOUND)
IF (OCTAVE_FOUND)
add_library(srslte_mex SHARED mexutils.c)
install(TARGETS srslte_mex DESTINATION ${LIBRARY_DIR})
liblte_set_pic(srslte_mex)
include_directories(${MATLAB_INCLUDE_DIR})
endif(MATLAB_FOUND)
if(OCTAVE_FOUND)
message(STATUS "Found OCTAVE in ${OCTAVE_INCLUDE_PATHS}")
ENDIF(OCTAVE_FOUND)
IF (MATLAB_FOUND OR OCTAVE_FOUND)
ADD_LIBRARY(srslte_mex SHARED mexutils.c)
INSTALL(TARGETS srslte_mex DESTINATION ${LIBRARY_DIR})
LIBLTE_SET_PIC(srslte_mex)
if (MATLAB_FOUND)
include_directories(${MATLAB_INCLUDE_DIR})
endif(MATLAB_FOUND)
if (OCTAVE_FOUND)
include_directories(${OCTAVE_INCLUDE_DIR})
endif (OCTAVE_FOUND)
ELSEIF (MATLAB_FOUND OR OCTAVE_FOUND)
message(STATUS "Could NOT find OCTAVE or MATLAB. MEX files won't be compiled")
ENDIF(MATLAB_FOUND OR OCTAVE_FOUND)
add_library(srslte_mex SHARED mexutils.c)
install(TARGETS srslte_mex DESTINATION ${LIBRARY_DIR})
liblte_set_pic(srslte_mex)
include_directories(${OCTAVE_INCLUDE_DIR})
endif(OCTAVE_FOUND)
if(NOT MATLAB_FOUND)
if(NOT OCTAVE_FOUND)
message(STATUS "Could NOT find OCTAVE or MATLAB. MEX files won't be compiled")
endif(NOT OCTAVE_FOUND)
endif(NOT MATLAB_FOUND)

Loading…
Cancel
Save