## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
INCLUDE(Common)
+FIND_PACKAGE(SWIG REQUIRED)
+
+INCLUDE(${SWIG_USE_FILE})
SET(PROJECT_HEADERS
Events.h
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)
--- /dev/null
+/* 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"