1 # Copyright (C) 2007-2012 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.
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(${SALOME_MACROS_DIR}/InstallAndCompilePythonFile.cmake)
22 FIND_PACKAGE(SWIG REQUIRED)
23 INCLUDE(${SWIG_USE_FILE})
25 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON)
26 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow")
29 ${PYTHON_INCLUDE_DIRS}
30 ${PTHREAD_INCLUDE_DIRS}
31 ${CMAKE_CURRENT_SOURCE_DIR}
32 ${CMAKE_CURRENT_BINARY_DIR}
34 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
35 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
36 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
37 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
38 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
39 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
42 SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i)
43 SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBS} ${PLATFORM_LIBS} medcoupling)
44 SET_TARGET_PROPERTIES(_MEDCoupling PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}")
46 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
47 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow")
49 SWIG_ADD_MODULE(MEDCouplingRemapper python MEDCouplingRemapper.i)
50 SWIG_LINK_LIBRARIES(MEDCouplingRemapper ${PYTHON_LIBS} medcouplingremapper)
51 SET_TARGET_PROPERTIES(_MEDCouplingRemapper PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}")
53 IF(${MACHINE} STREQUAL WINDOWS)
54 SET_TARGET_PROPERTIES(_MEDCouplingRemapper PROPERTIES DEBUG_OUTPUT_NAME _MEDCouplingRemapper_d)
55 SET_TARGET_PROPERTIES(_MEDCoupling PROPERTIES DEBUG_OUTPUT_NAME _MEDCoupling_d)
56 ENDIF(${MACHINE} STREQUAL WINDOWS)
57 INSTALL(TARGETS _MEDCoupling _MEDCouplingRemapper DESTINATION ${MED_salomelib_LIBS})
59 SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py ${CMAKE_CURRENT_SOURCE_DIR}/libMEDCoupling_Swig.py)
60 INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON})
62 INSTALL(FILES MEDCoupling.i MEDCouplingCommon.i MEDCouplingFinalize.i MEDCouplingRemapper.i MEDCouplingTypemaps.i DESTINATION ${MED_salomeinclude_HEADERS})
63 INSTALL(FILES MEDCouplingBasicsTest.py MEDCouplingRemapperTest.py MEDCouplingDataForTest.py DESTINATION ${MED_salomescript_PYTHON})
65 ADD_TEST(MEDCouplingBasicsTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest.py)
66 ADD_TEST(MEDCouplingExamplesTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingExamplesTest.py)
67 ADD_TEST(MEDCouplingRemapperTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingRemapperTest.py)