Skip to content

Commit

Permalink
Fix Matlab static interface generation
Browse files Browse the repository at this point in the history
Matlab static generation was not generated as stated in #1777
This patch would not be possible without the help of @yage99 !
  • Loading branch information
vigsterkr committed Mar 4, 2014
1 parent 8893a8f commit a000824
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -191,7 +191,7 @@ ENDIF()

# this has been only fixed in swig 2.0.12 or later.
IF (NOT ((CYGWIN AND ENABLE_TESTING) OR (DARWIN AND COMPILE_MODULAR_INTERFACE
AND SWIG_VERSION VERSION_LESS "2.0.12")))
AND SWIG_VERSION VERSION_LESS "2.0.12") OR MatlabStatic))
INCLUDE(CheckCXX11Features)

IF(_HAS_CXX11_FLAG)
Expand Down Expand Up @@ -950,7 +950,7 @@ ENDIF()
IF (MatlabStatic)
FIND_PACKAGE(Matlab REQUIRED)
IF(MATLAB_FOUND)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/matlab_modular)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/matlab_static)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/matlab_static)
ENDIF()
ELSE()
Expand Down
9 changes: 5 additions & 4 deletions src/interfaces/matlab_static/CMakeLists.txt
@@ -1,4 +1,5 @@
include_directories(${MATLAB_INCLUDE_DIR})

add_library(matlab_static SHARED MatlabInterface.cpp)
target_link_libraries(matlab_static shogun ${MATLAB_LIBRARIES})
ADD_CUSTOM_TARGET(matlab_static ALL
COMMAND "${MATLAB_ROOT}/bin/mex" -o sg -I${CMAKE_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/MatlabInterface.cpp $<TARGET_SONAME_FILE:shogun>
DEPENDS shogun
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Compiling MATLAB static interface")

0 comments on commit a000824

Please sign in to comment.