summaryrefslogtreecommitdiff
path: root/src/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-03-25 19:13:32 +0100
committerSander Vrijders <[email protected]>2016-03-25 19:13:32 +0100
commitd37add0f20c93432c0b4c12866810c124a7a18ec (patch)
treee6d115d469ce95627fc802b8ee454614e826059a /src/lib/CMakeLists.txt
parent35b00759a9616033aa19177ba3281eb9643509d2 (diff)
downloadouroboros-d37add0f20c93432c0b4c12866810c124a7a18ec.tar.gz
ouroboros-d37add0f20c93432c0b4c12866810c124a7a18ec.zip
build: Add protobuf-c commands for cmake
This adds a cmake file so that the build can ask to generate protobuf-c files from .proto files. The messages between the IRM and the library are compiled into the library.
Diffstat (limited to 'src/lib/CMakeLists.txt')
-rw-r--r--src/lib/CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 7ce98bf2..e05dce8b 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -3,6 +3,12 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR}/include)
+find_package(ProtobufC REQUIRED)
+
+include_directories(${PROTOBUF_INCLUDE_DIRS})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+protobuf_generate_c(PROTO_SRCS PROTO_HDRS irmd_messages.proto)
find_library(LIBRT_LIBRARIES rt)
if(NOT LIBRT_LIBRARIES)
@@ -30,8 +36,8 @@ set(SOURCE_FILES
utils.c
)
-add_library(ouroboros SHARED ${SOURCE_FILES})
-target_link_libraries(ouroboros rt pthread)
+add_library(ouroboros SHARED ${SOURCE_FILES} ${PROTO_SRCS} ${PROTO_HDRS})
+target_link_libraries(ouroboros rt pthread ${PROTOBUF_LIBRARIES})
include(MacroAddCompileFlags)
if (CMAKE_BUILD_TYPE MATCHES Debug)