forked from incf-music/ros-music-adapters
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·91 lines (69 loc) · 2.38 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
cmake_minimum_required(VERSION 2.8)
project(ros-music-adapter)
# add modules for finding JSONCPP, ZMQ and MUSIC
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
# generates catkin_INCLUDE_DIRS and catkin_LIBRARIES for all components
find_package(catkin REQUIRED
COMPONENTS
roscpp
roscpp_serialization
rosconsole
rostime
)
find_package(MUSIC REQUIRED)
find_package(JSONCPP REQUIRED)
find_package(MPI REQUIRED)
find_package(ZMQ REQUIRED)
find_package(MUSICADAPTER REQUIRED)
catkin_package(
CATKIN_DEPENDS
roscpp
roscpp_serialization
rosconsole
rostime
DEPENDS
MUSIC
MPI
JSONCPP
)
include_directories(
include
${MUSIC_INCLUDE_DIRS}
${JSONCPP_INCLUDE_DIRS}
${MPI_INCLUDE_PATH}
${ZMQ_INCLUDE_DIRS}
${MUSICADAPTER_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS})
set(CMAKE_CXX_FLAGS "-O3 -g -Wall")
find_library(GSL gsl REQUIRED)
find_library(BLAS gslcblas REQUIRED)
find_library(PTHREAD pthread REQUIRED)
add_library(rosmusicadapter SHARED base/ROSInPort.cpp
base/ROSOutPort.cpp)
include_directories(base/)
# Adapters
add_executable(ros_cont_adapter ros-adapters/ROSContAdapter.cpp)
add_executable(cont_ros_adapter ros-adapters/ContROSAdapter.cpp)
target_link_libraries(ros_cont_adapter rosmusicadapter ${catkin_LIBRARIES} ${MUSICADAPTER_LIBRARIES} ${ZMQ_LIBRARIES} ${MUSIC_LIBRARIES} ${PTHREAD} ${MPI_LIBRARIES} ${JSONCPP_LIBRARY})
target_link_libraries(cont_ros_adapter rosmusicadapter ${catkin_LIBRARIES} ${MUSICADAPTER_LIBRARIES} ${ZMQ_LIBRARIES} ${MUSIC_LIBRARIES} ${PTHREAD} ${MPI_LIBRARIES} ${JSONCPP_LIBRARY})
# INSTALL
install(TARGETS
ros_cont_adapter
cont_ros_adapter
rosmusicadapter
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
install(FILES
base/ROSInPort.h
base/ROSOutPort.h
DESTINATION include
)
################################################################################
################## Enable testing ##################
################################################################################
enable_testing()
add_test(NAME TestZMQ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_zmq_adapter COMMAND test.sh)