]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDCalculator/Swig/CMakeLists.txt
Salome HOME
addition of numpy
[tools/medcoupling.git] / src / MEDCalculator / Swig / CMakeLists.txt
1 # Copyright (C) 2012-2013  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 # 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   ${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
38   )
39
40 SET(medcalculatorspython_SOURCES
41   SPythonInterpreter.cxx
42   SPythonParser.cxx
43   )
44
45 ADD_LIBRARY(medcalculatorspython SHARED ${medcalculatorspython_SOURCES})
46 TARGET_LINK_LIBRARIES(medcalculatorspython interpkernel ${PYTHON_LIBRARIES})
47 INSTALL(TARGETS medcalculatorspython DESTINATION ${SALOME_INSTALL_LIBS})
48
49 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON)
50 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_DEFINITIONS "-shadow")
51 IF(NUMPY_FOUND)
52   SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS -DWITH_NUMPY)
53 ENDIF(NUMPY_FOUND)
54 SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i)
55 SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBS} medcalculator)
56
57 IF(WIN32)
58   SET_TARGET_PROPERTIES(_MEDCalculator PROPERTIES DEBUG_OUTPUT_NAME _MEDCalculator_d)
59 ENDIF(WIN32)
60
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})