From: Nicolas Geimer Date: Wed, 15 Mar 2017 13:26:12 +0000 (+0100) Subject: [PY3] Swig additional fixes X-Git-Tag: V9_0_0~25^2~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=58e0b79310280995ebb085025f52877897783df6;p=modules%2Fkernel.git [PY3] Swig additional fixes --- diff --git a/src/Communication_SWIG/CMakeLists.txt b/src/Communication_SWIG/CMakeLists.txt index 7ee54b5b8..9396baf81 100755 --- a/src/Communication_SWIG/CMakeLists.txt +++ b/src/Communication_SWIG/CMakeLists.txt @@ -20,7 +20,7 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(libSALOME_Comm.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(libSALOME_Comm.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET_SOURCE_FILES_PROPERTIES(libSALOME_Comm.i PROPERTIES SWIG_FLAGS "-py3") INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} diff --git a/src/DSC/DSC_Python/CMakeLists.txt b/src/DSC/DSC_Python/CMakeLists.txt index 48a6cb428..697747d88 100755 --- a/src/DSC/DSC_Python/CMakeLists.txt +++ b/src/DSC/DSC_Python/CMakeLists.txt @@ -21,6 +21,7 @@ FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(calcium.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(calcium.i PROPERTIES SWIG_FLAGS "-py3") SET(CMAKE_SWIG_FLAGS "-noexcept") ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS} ${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS}) diff --git a/src/LifeCycleCORBA_SWIG/CMakeLists.txt b/src/LifeCycleCORBA_SWIG/CMakeLists.txt index 6e8dbc3c2..4a8decb55 100755 --- a/src/LifeCycleCORBA_SWIG/CMakeLists.txt +++ b/src/LifeCycleCORBA_SWIG/CMakeLists.txt @@ -21,13 +21,13 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(libSALOME_LifeCycleCORBA.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(libSALOME_LifeCycleCORBA.i PROPERTIES SWIG_FLAGS "-py3") -SET_SOURCE_FILES_PROPERTIES(libSALOME_LifeCycleCORBA.i PROPERTIES SWIG_DEFINITIONS "-shadow") ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} + ${OMNIORBPY_INCLUDE_DIR} ${PROJECT_BINARY_DIR}/salome_adm ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} diff --git a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i index cfebfc51b..0cce5c6ee 100644 --- a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i +++ b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i @@ -45,27 +45,9 @@ typedef int Py_ssize_t; #define PY_SSIZE_T_MIN INT_MIN #endif -//--- from omniORBpy.h (not present on Debian Sarge packages) - -struct omniORBpyAPI { - - PyObject* (*cxxObjRefToPyObjRef)(const CORBA::Object_ptr cxx_obj, - CORBA::Boolean hold_lock); - // Convert a C++ object reference to a Python object reference. - // If is true, caller holds the Python interpreter lock. - - CORBA::Object_ptr (*pyObjRefToCxxObjRef)(PyObject* py_obj, - CORBA::Boolean hold_lock); - // Convert a Python object reference to a C++ object reference. - // Raises BAD_PARAM if the Python object is not an object reference. - // If is true, caller holds the Python interpreter lock. - - - omniORBpyAPI(); - // Constructor for the singleton. Sets up the function pointers. -}; - -omniORBpyAPI* api; +#include +#include +omniORBpyAPI* api=0; %} diff --git a/src/NOTIFICATION_SWIG/CMakeLists.txt b/src/NOTIFICATION_SWIG/CMakeLists.txt index bdc345db9..d041a89a6 100755 --- a/src/NOTIFICATION_SWIG/CMakeLists.txt +++ b/src/NOTIFICATION_SWIG/CMakeLists.txt @@ -20,7 +20,7 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES SWIG_FLAGS "-py3") SET_SOURCE_FILES_PROPERTIES(NOTIFICATIONPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS} -DHAVE_CONFIG_H") INCLUDE_DIRECTORIES(