Commit 50dd2e83 authored by Shervin Nourbakhsh's avatar Shervin Nourbakhsh
Browse files

Remove protobuf and include rapidjson as dependencies

parent fcf118ae
...@@ -28,9 +28,8 @@ endif() ...@@ -28,9 +28,8 @@ endif()
# Dependencies # Dependencies
#------------------------------------------------------------ #------------------------------------------------------------
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(ZeroMQ REQUIRED) # I cannot find it find_package(ZeroMQ REQUIRED)
find_package(Protobuf 3.0.0 REQUIRED) find_package(Rapidjson REQUIRED)
#------------------------------------------------------------ #------------------------------------------------------------
# Libraries # Libraries
...@@ -44,11 +43,8 @@ file(GLOB_RECURSE CAMEO_SOURCE_FILES "src/*.cpp") ...@@ -44,11 +43,8 @@ file(GLOB_RECURSE CAMEO_SOURCE_FILES "src/*.cpp")
#message(${CAMEO_PUBLIC_HEADER_FILES}) #message(${CAMEO_PUBLIC_HEADER_FILES})
#message(${CAMEO_SOURCE_FILES}) #message(${CAMEO_SOURCE_FILES})
# this generates the Messages.pb.h and Messages.pb.cc files add_library(cameo ${CAMEO_SOURCE_FILES})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS proto/Messages.proto) target_link_libraries(cameo PRIVATE zmq)
add_library(cameo ${CAMEO_SOURCE_FILES} ${PROTO_SRCS})
target_link_libraries(cameo PRIVATE zmq protobuf ${Protobuf_LIBRARIES})
target_include_directories(cameo target_include_directories(cameo
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} # this is to get protobuf messages PRIVATE ${CMAKE_CURRENT_BINARY_DIR} # this is to get protobuf messages
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/ # all the private headers PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/ # all the private headers
......
#.rst:
# FindRapidjson
# --------
#
# Find the native rapidjson includes and library.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# Rapidjson_INCLUDE_DIRS - where to find rapidjson/document.h, etc.
# Rapidjson_LIBRARIES - List of libraries when using rapidjson.
# Rapidjson_FOUND - True if rapidjson found.
#
# ::
#
#
# Hints
# ^^^^^
#
# A user may set ``RAPIDJSON_ROOT`` to a rapidjson installation root to tell this
# module where to look.
#=============================================================================
# Copyright 2018 OWenT.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file have been downloaded from: https://raw.githubusercontent.com/owent-contrib/rapidjson/aa4c227/contrib/cmake/FindRapidjson.cmake
unset(_RAPIDJSON_SEARCH_ROOT_INC)
unset(_RAPIDJSON_SEARCH_ROOT_LIB)
# Search RAPIDJSON_ROOT first if it is set.
if (Rapidjson_ROOT)
set(RAPIDJSON_ROOT ${Rapidjson_ROOT})
endif()
if(RAPIDJSON_ROOT)
set(_RAPIDJSON_SEARCH_ROOT_INC PATHS ${RAPIDJSON_ROOT} ${RAPIDJSON_ROOT}/include NO_DEFAULT_PATH)
endif()
# Try each search configuration.
find_path(Rapidjson_INCLUDE_DIRS NAMES rapidjson/document.h ${_RAPIDJSON_SEARCH_ROOT_INC})
mark_as_advanced(Rapidjson_INCLUDE_DIRS)
# handle the QUIETLY and REQUIRED arguments and set RAPIDJSON_FOUND to TRUE if
# all listed variables are TRUE
include("FindPackageHandleStandardArgs")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Rapidjson
REQUIRED_VARS Rapidjson_INCLUDE_DIRS
FOUND_VAR Rapidjson_FOUND
)
if(Rapidjson_FOUND)
set(RAPIDJSON_FOUND ${Rapidjson_FOUND})
endif()
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
List of packages: List of packages:
- cppzmq-devel - cppzmq-devel
- protobuf-devel - rapidjson-devel
``` ```
pkgs="zeromq-devel protobuf-devel" pkgs="zeromq-devel rapidjson-devel"
yum install -y $pkgs yum install -y $pkgs
``` ```
...@@ -28,3 +28,17 @@ cd build/ ...@@ -28,3 +28,17 @@ cd build/
cmake .. cmake ..
cmake --build . cmake --build .
``` ```
# To Do
- [ ] remove zmq deprecated methods
```
/opt/panosc/cameo/src/impl/SubscriberImpl.cpp:210:36: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t*, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations]
m_subscriber->recv(message.get());
^
In file included from /opt/panosc/cameo/src/impl/SocketWaitingImpl.h:23,
from /opt/panosc/cameo/src/impl/SubscriberImpl.h:20,
from /opt/panosc/cameo/src/impl/SubscriberImpl.cpp:17:
/usr/include/zmq.hpp:1267:10: note: declared here
bool recv(message_t *msg_, int flags_ = 0)
^~~~
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment