From: sbh Date: Wed, 24 Dec 2014 17:26:17 +0000 (+0300) Subject: SWIG wrapper for Events_Error:send() created. X-Git-Tag: V_0.7.0_rc1~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8315a37838ef4631b3657b5392cbbd1d243c96f1;p=modules%2Fshaper.git SWIG wrapper for Events_Error:send() created. --- diff --git a/src/Events/CMakeLists.txt b/src/Events/CMakeLists.txt index 492f4374a..2d7b6caf7 100644 --- a/src/Events/CMakeLists.txt +++ b/src/Events/CMakeLists.txt @@ -1,6 +1,9 @@ ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D INCLUDE(Common) +FIND_PACKAGE(SWIG REQUIRED) + +INCLUDE(${SWIG_USE_FILE}) SET(PROJECT_HEADERS Events.h @@ -24,6 +27,33 @@ SET(PROJECT_SOURCES ADD_DEFINITIONS(-DEVENTS_EXPORTS) ADD_LIBRARY(Events SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS}) +SET(CMAKE_SWIG_FLAGS -threads -Wall) + +SET_SOURCE_FILES_PROPERTIES(Events.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(Events.i PROPERTIES SWIG_DEFINITIONS "-shadow") + +INCLUDE_DIRECTORIES( + ${CAS_INCLUDE_DIRS} +) + TARGET_LINK_LIBRARIES(Events ${PROJECT_LIBRARIES}) +SET(SWIG_SCRIPTS + ${CMAKE_CURRENT_BINARY_DIR}/EventsAPI.py +) + +SET(SWIG_LINK_LIBRARIES + Events + ${PYTHON_LIBRARIES} +) + +SWIG_ADD_MODULE(EventsAPI python Events.i ${PROJECT_HEADERS}) +SWIG_LINK_LIBRARIES(EventsAPI ${SWIG_LINK_LIBRARIES}) + +IF(WIN32) + SET_TARGET_PROPERTIES(_EventsAPI PROPERTIES DEBUG_OUTPUT_NAME _EventsAPI_d) +ENDIF(WIN32) + INSTALL(TARGETS Events DESTINATION bin) +INSTALL(TARGETS _EventsAPI DESTINATION swig) +INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION swig) diff --git a/src/Events/Events.i b/src/Events/Events.i new file mode 100644 index 000000000..005c05758 --- /dev/null +++ b/src/Events/Events.i @@ -0,0 +1,19 @@ +/* Events.i */ +%module EventsAPI +%{ + #include "Events.h" + #include "Events_Error.h" + #include "Events_Message.h" +%} + + +// to avoid error on this +#define EVENTS_EXPORT + +// standard definitions +%include "typemaps.i" +%include "std_string.i" + +// all supported interfaces +%include "Events_Message.h" +%include "Events_Error.h"