1 # Copyright (C) 2012-2013 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
19 # Author : Anthony Geay (CEA/DEN)
21 ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
23 FIND_PACKAGE(SWIG REQUIRED)
24 INCLUDE(${SWIG_USE_FILE})
27 ${PYTHON_INCLUDE_DIRS}
28 ${MEDFILE_INCLUDE_DIRS}
30 ${CMAKE_CURRENT_SOURCE_DIR}
31 ${CMAKE_CURRENT_SOURCE_DIR}/..
32 ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader
33 ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader/Swig
34 ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling_Swig
35 ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling
36 ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL
37 ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases
40 SET(medcalculatorspython_SOURCES
41 SPythonInterpreter.cxx
45 ADD_LIBRARY(medcalculatorspython SHARED ${medcalculatorspython_SOURCES})
46 TARGET_LINK_LIBRARIES(medcalculatorspython interpkernel ${PYTHON_LIBRARIES})
47 INSTALL(TARGETS medcalculatorspython DESTINATION ${SALOME_INSTALL_LIBS})
49 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON)
50 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_DEFINITIONS "-shadow")
52 SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS -DWITH_NUMPY)
54 SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i)
55 SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBS} medcalculator)
58 SET_TARGET_PROPERTIES(_MEDCalculator PROPERTIES DEBUG_OUTPUT_NAME _MEDCalculator_d)
61 FILE(GLOB medcalculatorspython_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
62 INSTALL(FILES ${medcalculatorspython_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
63 INSTALL(TARGETS _MEDCalculator DESTINATION ${SALOME_INSTALL_PYTHON})
64 INSTALL(FILES MEDCalculator.i MEDCalculatorTypemaps.i DESTINATION ${SALOME_INSTALL_HEADERS})
65 INSTALL_AND_COMPILE_PYTHON_FILE(${CMAKE_CURRENT_BINARY_DIR}/MEDCalculator.py ${SALOME_INSTALL_PYTHON})