1 # Copyright (C) 2012-2016 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 INCLUDE(${SWIG_USE_FILE})
22 ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
24 SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES CPLUSPLUS ON)
25 IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
26 SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_FLAGS "-py3")
28 SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_DEFINITIONS "-shadow")
30 SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
33 SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_BOOST ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
37 SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_METIS ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
40 SET (MEDRenumber_SWIG_DPYS_FILES
44 ${PYTHON_INCLUDE_DIRS}
45 ${PTHREAD_INCLUDE_DIR} # pthread dependency due to python2.7 library
46 ${CMAKE_CURRENT_SOURCE_DIR}
48 ${CMAKE_CURRENT_BINARY_DIR}
49 ${CMAKE_CURRENT_SOURCE_DIR}/../RENUMBER
50 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling_Swig
51 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
52 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
53 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
54 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
55 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
56 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
59 SWIG_ADD_MODULE(MEDRenumber python MEDRenumber.i)
60 SWIG_LINK_LIBRARIES(MEDRenumber ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} renumbercpp)
61 SWIG_CHECK_GENERATION(MEDRenumber)
64 SET_TARGET_PROPERTIES(_MEDRenumber PROPERTIES DEBUG_OUTPUT_NAME _MEDRenumber_d)
66 INSTALL(TARGETS ${SWIG_MODULE_MEDRenumber_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
68 SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDRenumber.py ${MEDCOUPLING_INSTALL_PYTHON})
70 INSTALL(FILES MEDRenumber.i MEDRenumberCommon.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
71 INSTALL(FILES MEDRenumberTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
73 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR}/../MEDCoupling_Swig)
74 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
75 ADD_TEST(MEDRenumberTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDRenumberTest.py)
76 SET_TESTS_PROPERTIES(MEDRenumberTest PROPERTIES ENVIRONMENT "${tests_env}")
80 SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/RENUMBER_Swig)
81 INSTALL(FILES MEDRenumberTest.py DESTINATION ${TEST_INSTALL_DIRECTORY})
83 INSTALL(FILES CTestTestfileInstall.cmake
84 DESTINATION ${TEST_INSTALL_DIRECTORY}
85 RENAME CTestTestfile.cmake)