forked from ropod-project/ropod_com_mediator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
118 lines (98 loc) · 3.65 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
cmake_minimum_required(VERSION 2.8.6)
project(ropod_com_mediator)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(INSTALL_DIR /usr/lib CACHE PATH "Installation directory for mediator")
include(/opt/ropod/ropod_common/ropodcpp/ftsm/CMakeLists.txt)
########################################################################
# ROS dependency
########################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
message_generation
ropod_ros_msgs
tf2
tf2_msgs
tf2_ros
)
include_directories(
include
/opt/ropod/ropod_common/ropodcpp/zyre_communicator/include
${catkin_INCLUDE_DIRS}
)
#generate_messages(
# DEPENDENCIES
# ropod_ros_msgs
#)
#catkin_package(
## INCLUDE_DIRS include
# LIBRARIES ${PROJECT_NAME}
# CATKIN_DEPENDS roscpp ropod_ros_msgs
# DEPENDS message_runtime
#)
catkin_package(
CATKIN_DEPENDS roscpp ropod_ros_msgs
)
########################################################################
# LIBZMQ dependency
########################################################################
find_package(libzmq REQUIRED)
IF (LIBZMQ_FOUND)
include_directories(${LIBZMQ_INCLUDE_DIRS})
list(APPEND LIBS ${LIBZMQ_LIBRARIES})
ELSE (LIBZMQ_FOUND)
message( FATAL_ERROR "libzmq not found." )
ENDIF (LIBZMQ_FOUND)
########################################################################
# CZMQ dependency
########################################################################
find_package(czmq REQUIRED)
IF (CZMQ_FOUND)
include_directories(${CZMQ_INCLUDE_DIRS})
list(APPEND LIBS ${CZMQ_LIBRARIES})
ELSE (CZMQ_FOUND)
message( FATAL_ERROR "czmq not found." )
ENDIF (CZMQ_FOUND)
########################################################################
# Zyre dependency
########################################################################
find_package(zyre REQUIRED)
IF (ZYRE_FOUND)
include_directories(${ZYRE_INCLUDE_DIRS})
list(APPEND LIBS ${ZYRE_LIBRARIES})
ELSE (ZYRE_FOUND)
message( FATAL_ERROR "zyre not found." )
ENDIF (ZYRE_FOUND)
########################################################################
# JSON dependency
########################################################################
#pkg_check_modules(JSONCPP jsoncpp)
#target_link_libraries(${JSONCPP_LIBRARIES})
#include_directories(${JSONCPP_INCLUDE_DIRS})
find_package(jsoncpp REQUIRED)
IF (JSONCPP_FOUND)
include_directories(${JSONCPP_INCLUDE_DIRS})
list(APPEND LIBS ${JSONCPP_LIBRARIES})
ELSE (JSONCPP_FOUND)
message( FATAL_ERROR "JSONCPP not found." )
ENDIF (JSONCPP_FOUND)
########################################################################
# Mediator
########################################################################
#include_directories(${PROJECT_SOURCE_DIR}/include)
#set(HEADER_FILES ${PROJECT_SOURCE_DIR}/include/mediator.h)
add_executable(ropod_comm_mediator_test ${PROJECT_SOURCE_DIR}/src/test.cpp ${HEADER_FILES})
add_dependencies(ropod_comm_mediator_test ropod_ros_msgs_generate_messages_cpp)
target_link_libraries(ropod_comm_mediator_test ${LIBS})
add_executable(ropod_com_mediator
${PROJECT_SOURCE_DIR}/src/com_mediator.cpp
${HEADER_FILES}
/opt/ropod/ropod_common/ropodcpp/zyre_communicator/src/ZyreBaseCommunicator.cpp
/opt/ropod/ropod_common/ropodcpp/ftsm/src/ftsm_base.cpp
/opt/ropod/ftsm/cppftsm/src/ftsm.cpp
)
add_dependencies(ropod_com_mediator ropod_ros_msgs_generate_messages_cpp)
target_link_libraries(ropod_com_mediator ${LIBS} ${catkin_LIBRARIES} ${FTSM_LIBRARIES})