Salome HOME
[PY3] Update with MEDCoupling
[modules/med.git] / src / MEDCouplingCorba_Swig / Client / CMakeLists.txt
1 # Copyright (C) 2012-2016  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} ${OMNIORB_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
22 IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
23   ADD_DEFINITIONS(-DUSE_PYTHON3)
24 ENDIF()
25
26 FIND_PACKAGE(SWIG REQUIRED)
27 INCLUDE(${SWIG_USE_FILE})
28
29 SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES CPLUSPLUS ON)
30 SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_FLAGS "-py3")
31 SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
32
33 INCLUDE_DIRECTORIES(
34   ${PYTHON_INCLUDE_DIRS}
35   ${NUMPY_INCLUDE_DIR}
36   ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS}
37   ${MEDCOUPLING_INCLUDE_DIRS}
38   ${CMAKE_CURRENT_BINARY_DIR}/../../../idl
39   ${CMAKE_CURRENT_SOURCE_DIR}
40   ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCouplingCorba/Client
41   )
42
43 SWIG_ADD_MODULE(MEDCouplingClient python MEDCouplingClient.i)
44 SWIG_LINK_LIBRARIES(MEDCouplingClient ${PYTHON_LIBRARIES} medcouplingclient)
45 IF(WIN32)
46   SET_TARGET_PROPERTIES(_MEDCouplingClient PROPERTIES DEBUG_OUTPUT_NAME _MEDCouplingClient_d)
47 ENDIF(WIN32)
48
49 INSTALL(TARGETS _MEDCouplingClient DESTINATION ${SALOME_INSTALL_PYTHON})
50 INSTALL(FILES MEDCouplingClient.i DESTINATION ${SALOME_INSTALL_HEADERS})
51 SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingClient.py)
52 SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_PYTHON})