diff --git a/libmexclass/cpp/CMakeLists.txt b/libmexclass/cpp/CMakeLists.txt index 9e707a0..fa3b0db 100644 --- a/libmexclass/cpp/CMakeLists.txt +++ b/libmexclass/cpp/CMakeLists.txt @@ -59,9 +59,9 @@ macro(MatlabPrintVariables) message(STATUS "Matlab_HAS_CPP_API = ${Matlab_HAS_CPP_API}") message(STATUS "Matlab_MEX_EXTENSION = ${Matlab_MEX_EXTENSION}") message(STATUS "Matlab_INCLUDE_DIRS = ${Matlab_INCLUDE_DIRS}") - message(STATUS "Matlab_BINARIES_DIR = ${Matlab_BINARIES_DIR}") + #message(STATUS "Matlab_BINARIES_DIR = ${Matlab_BINARIES_DIR}") message(STATUS "Matlab_EXTERN_LIBRARY_DIR = ${Matlab_EXTERN_LIBRARY_DIR}") - message(STATUS "Matlab_EXTERN_BINARIES_DIR = ${Matlab_EXTERN_BINARIES_DIR}") + # message(STATUS "Matlab_EXTERN_BINARIES_DIR = ${Matlab_EXTERN_BINARIES_DIR}") endmacro() macro(MatlabSetWindowsVariables) @@ -105,19 +105,31 @@ macro(MatlabSetUnixVariables) endmacro() macro(MatlabConfigureVariables) - set(Matlab_VERSION_STRING "${MATLAB_RELEASE_VERSION}") - set(Matlab_INCLUDE_DIRS "${Matlab_ROOT_DIR}/extern/include") + if(WIN32) + set(MATLAB_BIN_DIR "${Matlab_ROOT_DIR}/extern/lib/win64/microsoft") + set(MATLAB_EXTERN_BIN_DIR "${Matlab_ROOT_DIR}/extern/lib/win64/microsoft") + set(MATLAB_EXTERN_LIB_DIR "${Matlab_ROOT_DIR}/extern/lib/win64") + elseif(APPLE) + set(MATLAB_BIN_DIR "${Matlab_ROOT_DIR}/bin/maci64") + set(MATLAB_EXTERN_BIN_DIR "${Matlab_ROOT_DIR}/extern/bin/maci64") + set(MATLAB_EXTERN_LIB_DIR "${Matlab_ROOT_DIR}/extern/lib/maci64") + elseif(UNIX AND NOT CYGWIN) + set(MATLAB_BIN_DIR "${Matlab_ROOT_DIR}/bin/glnxa64") + set(MATLAB_EXTERN_BIN_DIR "${Matlab_ROOT_DIR}/extern/bin/glnxa64") + set(MATLAB_EXTERN_LIB_DIR "${Matlab_ROOT_DIR}/extern/lib/glnxa64") + else() + message(FATAL_ERROR "Unsupported platform") + endif() set(Matlab_HAS_CPP_API 1) + set(Matlab_VERSION_STRING "${MATLAB_RELEASE_VERSION}") + set(Matlab_INCLUDE_DIRS "${Matlab_ROOT_DIR}/extern/include") + set(Matlab_ENGINE_LIBRARY "${MATLAB_EXTERN_BIN_DIR}/libMatlabEngine${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(Matlab_DATAARRAY_LIBRARY "${MATLAB_BIN_DIR}/libMatlabDataArray${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(Matlab_MEX_LIBRARY "${MATLAB_BIN_DIR}/libmex${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(Matlab_MX_LIBRARY "${MATLAB_BIN_DIR}/libmx${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(Matlab_ENGINE_LIBRARY "${Matlab_ROOT_DIR}/extern/bin/glnxa64/libMatlabEngine${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(Matlab_DATAARRAY_LIBRARY "${Matlab_ROOT_DIR}/bin/glnxa64/libMatlabDataArray${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(Matlab_MEX_LIBRARY "${Matlab_ROOT_DIR}/bin/glnxa64/libmex${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(Matlab_MX_LIBRARY "${Matlab_ROOT_DIR}/bin/glnxa64/libmx${CMAKE_SHARED_LIBRARY_SUFFIX}") - - set(Matlab_EXTERN_LIBRARY_DIR "${Matlab_ROOT_DIR}/extern/lib/glnxa64") - set(Matlab_BINARIES_DIR "${Matlab_ROOT_DIR}/bin/glnxa64") - set(Matlab_EXTERN_BINARIES_DIR "${Matlab_ROOT_DIR}/extern/bin/glnxa64") + set(Matlab_EXTERN_LIBRARY_DIR "${MATLAB_EXTERN_LIB_DIR") endmacro() macro(MatlabUnsetVariables) @@ -154,17 +166,17 @@ macro(MatlabConfigure) string(REGEX MATCH "([0-9]+[.])+[0-9]+" LONG_VERSION_STRING ${VERSION_XML_NODE}) string(REGEX MATCH "^[0-9]+[.][0-9]+" MATLAB_RELEASE_VERSION ${LONG_VERSION_STRING}) message(STATUS "MATLAB_RELEASE_VERSION = ${MATLAB_RELEASE_VERSION}") - - if (WIN32) - MatlabSetWindowsVariables() - elseif(APPLE) - MatlabSetAppleVariables() - elseif(UNIX AND NOT CYGWIN) - MatlabSetUnixVariables() - else() - message(FATAL_ERROR "MatlabConfigure failed") - endif() - endif() + MatlabConfigureVariables() + # if (WIN32) + # MatlabSetWindowsVariables() + # elseif(APPLE) + # MatlabSetAppleVariables() + # elseif(UNIX AND NOT CYGWIN) + # MatlabSetUnixVariables() + # else() + # message(FATAL_ERROR "MatlabConfigure failed") + # endif() + # endif() endmacro() # Find MATLAB.