Salome HOME
0022778: [CEA 1298] Python file compilation should be done at build time, not install...
[modules/med.git] / src / MEDCouplingCorba_Swig / Client / 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} ${OMNIORB_DEFINITIONS})
22
23 FIND_PACKAGE(SWIG REQUIRED)
24 INCLUDE(${SWIG_USE_FILE})
25
26 SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES CPLUSPLUS ON)
27 SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_DEFINITIONS "-shadow")
28 SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
29
30 INCLUDE_DIRECTORIES(
31   ${PYTHON_INCLUDE_DIRS}
32   ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS}
33   ${CMAKE_CURRENT_BINARY_DIR}/../../../idl
34   ${CMAKE_CURRENT_SOURCE_DIR}
35   ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCouplingCorba/Client
36   ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling_Swig
37   ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling
38   ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL
39   ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases
40   )
41
42 SWIG_ADD_MODULE(MEDCouplingClient python MEDCouplingClient.i)
43 SWIG_LINK_LIBRARIES(MEDCouplingClient ${PYTHON_LIBRARIES} medcouplingclient)
44 IF(WIN32)
45   SET_TARGET_PROPERTIES(_MEDCouplingClient PROPERTIES DEBUG_OUTPUT_NAME _MEDCouplingClient_d)
46 ENDIF(WIN32)
47
48 INSTALL(TARGETS _MEDCouplingClient DESTINATION ${SALOME_INSTALL_PYTHON})
49 INSTALL(FILES MEDCouplingClient.i DESTINATION ${SALOME_INSTALL_HEADERS})
50 SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingClient.py)
51 SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_PYTHON})