-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
INCLUDE(${SWIG_USE_FILE})
-ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
+ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY};-DWITHOUT_AUTOFIELD")
-
-IF(Boost_FOUND)
- SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_BOOST ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
-ENDIF(Boost_FOUND)
-
-IF(METIS_FOUND)
- SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_METIS ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
-ENDIF(METIS_FOUND)
+IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
+ SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_FLAGS "-py3")
+ELSE()
+ SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+ENDIF()
+SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
SET (MEDRenumber_SWIG_DPYS_FILES
- MEDRenumberCommon.i)
+ MEDRenumberCommon.i
+ MEDRenumberImpl.i)
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR} # pthread dependancy due to python2.7 library
+ ${PTHREAD_INCLUDE_DIR} # pthread dependency due to python2.7 library
${CMAKE_CURRENT_SOURCE_DIR}
+ ${NUMPY_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../RENUMBER
${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling_Swig
SWIG_ADD_MODULE(MEDRenumber python MEDRenumber.i)
SWIG_LINK_LIBRARIES(MEDRenumber ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} renumbercpp)
+SWIG_CHECK_GENERATION(MEDRenumber)
IF(WIN32)
SET_TARGET_PROPERTIES(_MEDRenumber PROPERTIES DEBUG_OUTPUT_NAME _MEDRenumber_d)
ENDIF(WIN32)
INSTALL(TARGETS ${SWIG_MODULE_MEDRenumber_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
-SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDRenumber.py ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDRenumber.py ${MEDCOUPLING_INSTALL_PYTHON})
-INSTALL(FILES MEDRenumber.i MEDRenumberCommon.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
+INSTALL(FILES MEDRenumber.i MEDRenumberCommon.i MEDRenumberImpl.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
INSTALL(FILES MEDRenumberTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR}/../MEDCoupling_Swig)
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
ADD_TEST(MEDRenumberTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDRenumberTest.py)
SET_TESTS_PROPERTIES(MEDRenumberTest PROPERTIES ENVIRONMENT "${tests_env}")
+ADD_TEST(MEDRenumberUserGuide ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/UsersGuideExamplesTest.py)
+SET_TESTS_PROPERTIES(MEDRenumberUserGuide PROPERTIES ENVIRONMENT "${tests_env}")
# Application tests
-SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS}/test/MEDCoupling/RENUMBER_Swig)
+SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/RENUMBER_Swig)
INSTALL(FILES MEDRenumberTest.py DESTINATION ${TEST_INSTALL_DIRECTORY})
INSTALL(FILES CTestTestfileInstall.cmake