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} ${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
24 SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES CPLUSPLUS ON)
25 SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES SWIG_DEFINITIONS "-shadow")
26 SET(SWIG_MODULE_MEDPartitioner_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
28 SET (MEDPartitioner_SWIG_DPYS_FILES
29 MEDPartitionerCommon.i)
32 ${PYTHON_INCLUDE_DIRS}
33 ${PTHREAD_INCLUDE_DIR} # pthread dependancy due to python2.7 library
35 ${CMAKE_CURRENT_SOURCE_DIR}
36 ${CMAKE_CURRENT_BINARY_DIR}
38 ${MEDFILE_INCLUDE_DIRS}
39 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDPartitioner
40 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling_Swig
41 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
42 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader
43 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader/Swig
44 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
45 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
46 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
47 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
48 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
51 SWIG_ADD_MODULE(MEDPartitioner python MEDPartitioner.i)
52 SWIG_LINK_LIBRARIES(MEDPartitioner ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medpartitionercpp)
55 SET_TARGET_PROPERTIES(_MEDPartitioner PROPERTIES DEBUG_OUTPUT_NAME _MEDPartitioner_d)
57 INSTALL(TARGETS ${SWIG_MODULE_MEDPartitioner_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
59 SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDPartitioner.py)
60 SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
62 INSTALL(FILES MEDPartitioner.i MEDPartitionerCommon.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
63 INSTALL(FILES MEDPartitionerTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
65 IF(MEDCOUPLING_PARTITIONER_METIS)
66 # Python test of partitionner require METIS or PARMETIS?
67 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR}/../MEDLoader/Swig)
68 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
69 ADD_TEST(MEDPartitionerTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDPartitionerTest.py)
70 SET_TESTS_PROPERTIES(MEDPartitionerTest PROPERTIES ENVIRONMENT "${tests_env}")
71 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader/Swig/MEDLoaderDataForTest.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
76 SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/MEDPartitioner_Swig)
77 INSTALL(FILES MEDPartitionerTest.py DESTINATION ${TEST_INSTALL_DIRECTORY})
79 INSTALL(FILES CTestTestfileInstall.cmake
80 DESTINATION ${TEST_INSTALL_DIRECTORY}
81 RENAME CTestTestfile.cmake)