Skip to content

Commit

Permalink
On the way to fix octave_modular interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed Aug 5, 2013
1 parent 1c40b9e commit b180b08
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cmake/FindOctave.cmake
Expand Up @@ -126,12 +126,13 @@ find_library( OCTAVE_CRUFT_LIBRARY
set ( OCTAVE_LIBRARIES ${OCTAVE_OCTINTERP_LIBRARY} )
list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_OCTAVE_LIBRARY} )
list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_CRUFT_LIBRARY} )

find_path ( OCTAVE_INCLUDE_DIR
NAMES mex.h
HINTS ${OCTAVE_INCLUDE_PATHS} ${OCTAVE_INCLUDE_PATHS}/octave
HINTS ${OCTAVE_INCLUDE_PATHS}
)


STRING(REGEX REPLACE "(.*)/octave$" "\\1" OCTAVE_INCLUDE_DIR ${OCTAVE_INCLUDE_DIR})
set ( OCTAVE_INCLUDE_DIRS ${OCTAVE_INCLUDE_DIR} )

macro ( octave_add_oct FUNCTIONNAME )
Expand Down
4 changes: 2 additions & 2 deletions examples/undocumented/octave_modular/CMakeLists.txt
Expand Up @@ -5,6 +5,6 @@ FOREACH(EXAMPLE ${OCTAVE_EXAMPLES})
add_test(NAME octave_modular-${EXAMPLE_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${OCTAVE_EXECUTABLE} ${EXAMPLE})
# set_property(TEST octave_modular-${EXAMPLE_NAME} PROPERTY
# ENVIRONMENT "LUA_CPATH=${LUA_MODULAR_BUILD_DIR}/libmodshogun.so")
set_property(TEST octave_modular-${EXAMPLE_NAME} PROPERTY
ENVIRONMENT "${OCTAVE_OCT_LOCAL_API_FILE_DIR}/shogun")
ENDFOREACH()
14 changes: 13 additions & 1 deletion src/interfaces/octave_modular/CMakeLists.txt
Expand Up @@ -4,7 +4,19 @@ include_directories(${OCTAVE_INCLUDE_DIRS})
GENERATE_MODULAR_TARGET(octave ${CMAKE_CURRENT_SOURCE_DIR} ${OCTAVE_LIBRARIES})

install (TARGETS octave_modular
DESTINATION ${OCTAVE_OCT_LOCAL_API_FILE_DIR}
DESTINATION ${OCTAVE_OCT_LOCAL_API_FILE_DIR}/shogun
COMPONENT octave)

file(WRITE init_shogun.m "%Initialize shogun by loading all of its modules")

# for i in $(SWIGLIBFILES) ; do echo $$i | sed -e 's=.*/==' -e 's/\.oct/;/' \
# >>$(DESTDIR)$(OCTDIR)/shogun/init_shogun.m; done
#FOREACH()
# file(APPEND init_shogun.m "")
#ENDFOREACH()

INSTALL(FILES init_shogun.m
DESTINATION ${OCTAVE_OCT_LOCAL_API_FILE_DIR}/shogun
COMPONENT octave)

set(CPACK_COMPONENT_OCTAVE_DISPLAY_NAME "OCTAVE interface" PARENT_SCOPE)
Expand Down

0 comments on commit b180b08

Please sign in to comment.