#
#  Copyright (C) 2008-2014 National Institute For Space Research (INPE) - Brazil.
#
#  This file is part of the TerraLib - a Framework for building GIS enabled applications.
#
#  TerraLib is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation, either version 3 of the License,
#  or (at your option) any later version.
#
#  TerraLib is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License
#  along with TerraLib. See COPYING. If not, write to
#  TerraLib Team at <terralib-team@terralib.org>.
#
#
#  Description: CMake script for the TerraLib Python binding.
#
#  Author: Matheus Cavassan Zaglia <mzaglia@dpi.inpe.br>
#

include(${SWIG_USE_FILE})

include(${terralib_SOURCE_DIR}/terralib_conf.cmake)

set (CMAKE_SWIG_FLAGS "-c++")

include_directories (
  "${TERRALIB_ABSOLUTE_ROOT_DIR}/src"
  "${CMAKE_BINARY_DIR}"
  "${PYTHON_INCLUDE_DIRS}"
)

set(CMAKE_SWIG_OUTDIR "${CMAKE_BINARY_DIR}/bindings/${TERRALIB_MOD_BINDING_PYTHON_DIR}")
set(TERRALIB_MOD_BINDING_PYTHON_INSTALL_DIR "${TERRALIB_DESTINATION_BINDINGS}/${TERRALIB_MOD_BINDING_PYTHON_DIR}")

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_core
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/Core.i)

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_common
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/Common.i)

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_dataaccess
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/DataAccess.i)

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_datatype
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/DataType.i)

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_geometry
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/Geometry.i)

#TERRALIB_ADD_PYTHON_BINDING(terralib_mod_memory
#  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/Memory.i)

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_raster
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/Raster.i)

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_rp
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/RP.i)

TERRALIB_ADD_PYTHON_BINDING(terralib_mod_srs
  ${TERRALIB_ABSOLUTE_ROOT_DIR}/src/terralib/binding/swig/python/SRS.i)

configure_file("${CMAKE_SOURCE_DIR}/terralib_mod_binding_python/__init__.py.in"
               "${CMAKE_SWIG_OUTDIR}/__init__.py" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/terralib_mod_binding_python/setup.py.in"
               "${CMAKE_SWIG_OUTDIR}/../setup.py" @ONLY)

install (FILES "${CMAKE_SWIG_OUTDIR}/__init__.py"
         DESTINATION "${TERRALIB_MOD_BINDING_PYTHON_INSTALL_DIR}")

install (FILES "${CMAKE_SWIG_OUTDIR}/../setup.py"
DESTINATION "${TERRALIB_MOD_BINDING_PYTHON_INSTALL_DIR}/..")
