# CMake script for PyOSSIM
# Author: Vipul Raheja

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# Find SWIG
FIND_PACKAGE(SWIG REQUIRED)
IF(NOT SWIG_FOUND)
   MESSAGE(SEND_ERROR "SWIG Libraries not found, you need them in order to build PyOSSIM")
ENDIF(NOT SWIG_FOUND)

# Include SWIG
INCLUDE(${SWIG_USE_FILE})

# Find Python Libraries
FIND_PACKAGE(PythonLibs REQUIRED)
IF(NOT PYTHONLIBS_FOUND)
   MESSAGE(SEND_ERROR "Python Libraries not found, you need them in order to build PyOSSIM")
ENDIF(NOT PYTHONLIBS_FOUND)

# Include Python
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

INCLUDE_DIRECTORIES(/usr/local/include)

SET(CMAKE_SWIG_FLAGS "-c++")

SET(MODULE_NAME pyossim)
SET(INTERFACE_FILE master.i)

SET_SOURCE_FILES_PROPERTIES(${INTERFACE_FILE} PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(${INTERFACE_FILE} PROPERTIES CMAKE_SWIG_FLAGS "-includeall")

SWIG_ADD_MODULE(${MODULE_NAME} python ${INTERFACE_FILE})
SWIG_LINK_LIBRARIES(${MODULE_NAME} ossim ${PYTHON_LIBRARIES})
