From: Gilles DAVID Date: Thu, 20 Apr 2017 08:17:35 +0000 (+0200) Subject: [PY3] Update with MEDCoupling X-Git-Tag: V9_0_0~5^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4a05c22befea001530ce001b74921765c67969ad;p=modules%2Fmed.git [PY3] Update with MEDCoupling --- diff --git a/src/MEDCalculator/Swig/CMakeLists.txt b/src/MEDCalculator/Swig/CMakeLists.txt index 0ce37e87e..8833bb745 100644 --- a/src/MEDCalculator/Swig/CMakeLists.txt +++ b/src/MEDCalculator/Swig/CMakeLists.txt @@ -19,6 +19,9 @@ # Author : Anthony Geay (CEA/DEN) ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) +IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3") + ADD_DEFINITIONS(-DUSE_PYTHON3) +ENDIF() FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -43,7 +46,7 @@ TARGET_LINK_LIBRARIES(medcalculatorspython ${MEDCoupling_interpkernel} ${PYTHON_ INSTALL(TARGETS medcalculatorspython DESTINATION ${SALOME_INSTALL_LIBS}) SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_FLAGS "-py3") SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i) SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBRARIES} medcalculator) diff --git a/src/MEDCalculator/Swig/MEDCalculator.i b/src/MEDCalculator/Swig/MEDCalculator.i index 2a75aff0c..c0aa77c0c 100644 --- a/src/MEDCalculator/Swig/MEDCalculator.i +++ b/src/MEDCalculator/Swig/MEDCalculator.i @@ -439,6 +439,7 @@ def ParaMEDMEMMEDFileUMeshnew(cls,*args): %include "MEDCouplingFinalize.i" %pythoncode %{ +MEDCalculatorDBFieldReal.__rtruediv__ = MEDCalculatorDBFieldReal.__rdiv__ MEDFileUMesh.__new__=classmethod(ParaMEDMEMMEDFileUMeshnew) del ParaMEDMEMMEDFileUMeshnew %} diff --git a/src/MEDCouplingCorba_Swig/CMakeLists.txt b/src/MEDCouplingCorba_Swig/CMakeLists.txt index 651b535cb..8d9c2ae34 100644 --- a/src/MEDCouplingCorba_Swig/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/CMakeLists.txt @@ -21,12 +21,15 @@ ADD_SUBDIRECTORY(Client) ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) +IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3") + ADD_DEFINITIONS(-DUSE_PYTHON3) +ENDIF() FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_FLAGS "-py3") SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") SET(MEDCouplingCorba_SWIG_DPYS_FILES diff --git a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt index cc08d6198..fd974c157 100644 --- a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt @@ -19,12 +19,15 @@ # Author : Anthony Geay (CEA/DEN) ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) +IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3") + ADD_DEFINITIONS(-DUSE_PYTHON3) +ENDIF() FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_FLAGS "-py3") SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") INCLUDE_DIRECTORIES(