Skip to content

Commit

Permalink
Use SHARED_LIB_SUFFIX when on windows only
Browse files Browse the repository at this point in the history
  • Loading branch information
sgilmore10 committed Nov 28, 2023
1 parent 1e86619 commit ffaa92d
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions libmexclass/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,40 @@ macro(MatlabConfigureVariables)
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")
set(SHARED_LIB_SUFFIX "${CMAKE_LINK_LIBRARY_SUFFIX}")
else
set(SHARED_LIB_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
if(APPLE)
set(PLATFORM_FOLDER "maci64")
elseif(UNIX And NOT CYGWIN)
set(PLATFORM_FOLDER "maci64")
else()
message(FATAL_ERROR "Unsupported platform")
endif()
set(MATLAB_BIN_DIR "${Matlab_ROOT_DIR}/bin/${PLATFORM_FOLDER}")
set(MATLAB_EXTERN_BIN_DIR "${Matlab_ROOT_DIR}/extern/bin/${PLATFORM_FOLDER}")
set(MATLAB_EXTERN_LIB_DIR "${Matlab_ROOT_DIR}/extern/lib/${PLATFORM_FOLDER}")
endif()

# if(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_LINK_LIBRARY_SUFFIX}")
set(Matlab_DATAARRAY_LIBRARY "${MATLAB_BIN_DIR}/libMatlabDataArray${CMAKE_LINK_LIBRARY_SUFFIX}")
set(Matlab_MEX_LIBRARY "${MATLAB_BIN_DIR}/libmex${CMAKE_LINK_LIBRARY_SUFFIX}")
set(Matlab_MX_LIBRARY "${MATLAB_BIN_DIR}/libmx${CMAKE_LINK_LIBRARY_SUFFIX}")

set(Matlab_ENGINE_LIBRARY "${MATLAB_EXTERN_BIN_DIR}/libMatlabEngine${SHARED_LIB_SUFFIX}")
set(Matlab_DATAARRAY_LIBRARY "${MATLAB_BIN_DIR}/libMatlabDataArray${SHARED_LIB_SUFFIX}")
set(Matlab_MEX_LIBRARY "${MATLAB_BIN_DIR}/libmex${SHARED_LIB_SUFFIX}")
set(Matlab_MX_LIBRARY "${MATLAB_BIN_DIR}/libmx${SHARED_LIB_SUFFIX}")
set(Matlab_EXTERN_LIBRARY_DIR "${MATLAB_EXTERN_LIB_DIR}")
endmacro()

Expand Down

0 comments on commit ffaa92d

Please sign in to comment.