]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDCoupling_Swig/CMakeLists.txt
Salome HOME
bbd5f1848a4cd37687a092f9ddb4804028445d9d
[tools/medcoupling.git] / src / MEDCoupling_Swig / CMakeLists.txt
1 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 INCLUDE(${SALOME_MACROS_DIR}/InstallAndCompilePythonFile.cmake)
21
22 FIND_PACKAGE(SWIG REQUIRED)
23 INCLUDE(${SWIG_USE_FILE})
24
25 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON)
26 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow")
27
28 INCLUDE_DIRECTORIES(
29   ${PYTHON_INCLUDE_DIRS}
30   ${PTHREAD_INCLUDE_DIRS}
31   ${CMAKE_CURRENT_SOURCE_DIR}
32   ${CMAKE_CURRENT_BINARY_DIR}
33   ${CMAKE_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
40   )
41
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}")
45
46 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
47 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow")
48
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}")
52
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})
58
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})
61
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})
64
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)