2013-10-11 10:06:24 +02:00
|
|
|
|
|
|
|
# Define the current source locations
|
|
|
|
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/protoserver)
|
|
|
|
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/protoserver)
|
|
|
|
|
|
|
|
include_directories(
|
2014-12-20 13:15:20 +01:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${PROTOBUF_INCLUDE_DIRS}
|
|
|
|
)
|
2013-10-11 10:06:24 +02:00
|
|
|
|
|
|
|
# Group the headers that go through the MOC compiler
|
|
|
|
set(ProtoServer_QT_HEADERS
|
2014-12-20 13:15:20 +01:00
|
|
|
${CURRENT_HEADER_DIR}/ProtoServer.h
|
|
|
|
${CURRENT_HEADER_DIR}/ProtoConnection.h
|
|
|
|
${CURRENT_SOURCE_DIR}/ProtoClientConnection.h
|
|
|
|
${CURRENT_HEADER_DIR}/ProtoConnectionWrapper.h
|
2013-10-11 10:06:24 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
set(ProtoServer_HEADERS
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ProtoServer_SOURCES
|
2014-12-20 13:15:20 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/ProtoServer.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/ProtoClientConnection.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/ProtoConnection.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/ProtoConnectionWrapper.cpp
|
2013-10-11 10:06:24 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
set(ProtoServer_PROTOS
|
2014-12-20 13:15:20 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/message.proto
|
2013-10-11 10:06:24 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
protobuf_generate_cpp(ProtoServer_PROTO_SRCS ProtoServer_PROTO_HDRS
|
2014-12-20 13:15:20 +01:00
|
|
|
${ProtoServer_PROTOS}
|
2013-10-11 10:06:24 +02:00
|
|
|
)
|
|
|
|
|
2016-01-06 17:31:23 +01:00
|
|
|
if(ENABLE_QT5)
|
|
|
|
qt5_wrap_cpp(ProtoServer_HEADERS_MOC ${ProtoServer_QT_HEADERS})
|
|
|
|
else(ENABLE_QT5)
|
2013-10-11 10:06:24 +02:00
|
|
|
qt4_wrap_cpp(ProtoServer_HEADERS_MOC ${ProtoServer_QT_HEADERS})
|
2016-01-06 17:31:23 +01:00
|
|
|
endif(ENABLE_QT5)
|
2013-10-11 10:06:24 +02:00
|
|
|
|
|
|
|
add_library(protoserver
|
2014-12-20 13:15:20 +01:00
|
|
|
${ProtoServer_HEADERS}
|
|
|
|
${ProtoServer_QT_HEADERS}
|
|
|
|
${ProtoServer_SOURCES}
|
|
|
|
${ProtoServer_HEADERS_MOC}
|
|
|
|
${ProtoServer_PROTOS}
|
|
|
|
${ProtoServer_PROTO_SRCS}
|
|
|
|
${ProtoServer_PROTO_HDRS}
|
2013-10-11 10:06:24 +02:00
|
|
|
)
|
2016-01-06 17:31:23 +01:00
|
|
|
if(ENABLE_QT5)
|
|
|
|
qt5_use_modules(protoserver Widgets)
|
|
|
|
endif(ENABLE_QT5)
|
2013-10-11 10:06:24 +02:00
|
|
|
|
|
|
|
target_link_libraries(protoserver
|
2014-12-20 13:15:20 +01:00
|
|
|
hyperion
|
|
|
|
hyperion-utils
|
|
|
|
protobuf
|
|
|
|
${QT_LIBRARIES}
|
|
|
|
)
|