Salome HOME
refactor MED to use external MEDtool
[modules/med.git] / src / MEDCalculator / Swig / CMakeLists.txt
1 # Copyright (C) 2012-2015  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, or (at your option) any later version.
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 # Author : Anthony Geay (CEA/DEN)
20
21 ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
22
23 FIND_PACKAGE(SWIG REQUIRED)
24 INCLUDE(${SWIG_USE_FILE})
25
26 INCLUDE_DIRECTORIES(
27   ${PYTHON_INCLUDE_DIRS}
28   ${MEDFILE_INCLUDE_DIRS}
29   ${HDF5_INCLUDE_DIRS}
30   ${MEDTOOL_INCLUDE_DIRS}
31   ${CMAKE_CURRENT_SOURCE_DIR}
32   ${CMAKE_CURRENT_SOURCE_DIR}/..
33   )
34
35 SET(medcalculatorspython_SOURCES
36   SPythonInterpreter.cxx
37   SPythonParser.cxx
38   )
39
40 ADD_LIBRARY(medcalculatorspython SHARED ${medcalculatorspython_SOURCES})
41 TARGET_LINK_LIBRARIES(medcalculatorspython ${INTERPKERNEL_LIBRARY} ${PYTHON_LIBRARIES})
42 INSTALL(TARGETS medcalculatorspython DESTINATION ${SALOME_INSTALL_LIBS})
43
44 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON)
45 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_DEFINITIONS "-shadow")
46 SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
47 SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i)
48 SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBRARIES} medcalculator)
49
50 IF(WIN32)
51   SET_TARGET_PROPERTIES(_MEDCalculator PROPERTIES DEBUG_OUTPUT_NAME _MEDCalculator_d)
52 ENDIF(WIN32)
53
54 FILE(GLOB medcalculatorspython_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
55 INSTALL(FILES ${medcalculatorspython_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
56 INSTALL(TARGETS _MEDCalculator DESTINATION ${SALOME_INSTALL_PYTHON})
57 INSTALL(FILES MEDCalculator.i MEDCalculatorTypemaps.i DESTINATION ${SALOME_INSTALL_HEADERS})
58 SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDCalculator.py ${SALOME_INSTALL_PYTHON})