SET(LIB_NAME interface)
SET(LIB_OUTNAME traph-${LIB_NAME})

SET(SOURCE_PATH ${TRAPH_PATH_SOURCE}/${LIB_NAME})

FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

SET(CMAKE_SWIG_FLAGS "")

SET_SOURCE_FILES_PROPERTIES(traph_tensor.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(traph_tensor.i PROPERTIES SWIG_FLAGS "-includeall")

IF(ENABLE_PYTHON)
    FIND_PACKAGE(PythonLibs)
    INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

    SWIG_ADD_LIBRARY(traph_tensor LANGUAGE python SOURCES traph_tensor.i)
    SWIG_LINK_LIBRARIES(traph_tensor ${PYTHON_LIBRARIES})
    SWIG_LINK_LIBRARIES(traph_tensor traph-core)
    SWIG_LINK_LIBRARIES(traph_tensor traph-tensor)
    SWIG_LINK_LIBRARIES(traph_tensor traph-nn)
ENDIF()

