Skip to content
Snippets Groups Projects
Commit 16b04ba7 authored by Christian Nowke's avatar Christian Nowke
Browse files

added dependent libraries since this must be a dynamic library

parent 8291b09e
No related branches found
No related tags found
No related merge requests found
......@@ -9,22 +9,27 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y" )
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( PROTOBUF_BIN "" CACHE FILEPATH "The protobuf binary directory for the schema compiler 'protoc'" )
set( PROTOBUF_INCLUDE_DIR "" CACHE FILEPATH "The protobuf include directory" )
set( PROTOBUF_BIN "" CACHE PATH "The protobuf binary directory for the schema compiler 'protoc'" )
set( PROTOBUF_INCLUDE_DIR "" CACHE PATH "The protobuf include directory" )
set( PROTOBUF_LIBRARY "" CACHE FILEPATH "The protobuf library to link against" )
set( PROTOBUF_LIBRARY_DEBUG "" CACHE FILEPATH "The protobuf library to link against" )
set( BOOST_INCLUDE_DIR "" CACHE FILEPATH "The boost include path" )
set( BOOST_INCLUDE_DIR "" CACHE PATH "The boost include path" )
set( BOOST_PYTHON_LIBRARY "" CACHE FILEPATH "The boost python library to link against" )
set( BOOST_PYTHON_LIBRARY_DEBUG "" CACHE FILEPATH "The boost python debug library to link against" )
set (PYTHON_INCLUDE_DIR "" CACHE FILEPATH "The python include path" )
set (PYTHON_INCLUDE_DIR "" CACHE PATH "The python include path" )
set (PYTHON_LIBRARY "" CACHE FILEPATH "The python library to link against" )
set (PYTHON_LIBRARY_DEBUG "" CACHE FILEPATH "The python debug library to link against" )
set (NETT_INCLUDE_DIR "" CACHE FILEPATH "The nett include path" )
set (NETT_SCHEMA_DIR "" CACHE FILEPATH "The nett schema path" )
set (NETT_INCLUDE_DIR "" CACHE PATH "The nett include path" )
set (NETT_SCHEMA_DIR "" CACHE PATH "The nett schema path" )
set (NETT_LIBRARY "" CACHE FILEPATH "The nett library to link against" )
set (NETT_LIBRARY_DEBUG "" CACHE FILEPATH "The nett debug library to link against" )
set( ZMQ_LIBRARY "" CACHE FILEPATH "The zmq library to link against" )
include( "include/nett-python/_SourceFiles.cmake" )
include( "src/nett-python/_SourceFiles.cmake" )
......@@ -40,6 +45,8 @@ add_library (nett_python SHARED ${ProjectSources})
target_link_libraries( nett_python optimized ${NETT_LIBRARY} debug ${NETT_LIBRARY_DEBUG})
target_link_libraries( nett_python optimized ${PYTHON_LIBRARY} debug ${PYTHON_LIBRARY_DEBUG})
target_link_libraries( nett_python optimized ${BOOST_PYTHON_LIBRARY} debug ${BOOST_PYTHON_LIBRARY_DEBUG})
target_link_libraries( nett_python optimized ${PROTOBUF_LIBRARY} debug ${PROTOBUF_LIBRARY_DEBUG})
target_link_libraries( nett_python ${ZMQ_LIBRARY} )
add_event ( nett_python routing_message ${NETT_SCHEMA_DIR} ${PROJECT_BINARY_DIR} )
add_event ( nett_python string_message ${NETT_SCHEMA_DIR} ${PROJECT_BINARY_DIR} )
......
......@@ -7,11 +7,26 @@
#include <nett/nett.h>
#include <memory>
#include <../schema/string_message.pb.h>
using namespace boost::python;
std::shared_ptr<nett::slot_in<string_message>> create_slot_in_string_message()
{
return nett::make_slot_in<string_message>();
}
//nett::make_slot_out<string_message>(const std::string &slot_tag);
BOOST_PYTHON_MODULE(nett_python)
{
def("initialize", &nett::initialize);
class_ < nett::slot_in < string_message >, boost::noncopyable >( "slot_in_string", no_init );
}
\ No newline at end of file
import nett_python as nett
nett.initialize("tcp://127.0.0.1:6555")
import string_message_pb2
nett.initialize("tcp://127.0.0.1:65551")
message = string_message_pb2.string_message()
message.value = 'hi there'
byte_stream = message.SerializeToString()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment