forked from openspur/ypspur_ros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
105 lines (87 loc) · 2.32 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
cmake_minimum_required(VERSION 3.0.2)
project(ypspur_ros)
find_package(catkin REQUIRED COMPONENTS
roscpp
message_generation
diagnostic_msgs
geometry_msgs
nav_msgs
sensor_msgs
std_msgs
tf
trajectory_msgs
)
add_message_files(
FILES
DigitalOutput.msg
DigitalInput.msg
ControlMode.msg
JointPositionControl.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(CATKIN_DEPENDS
roscpp
message_runtime
diagnostic_msgs
geometry_msgs
nav_msgs
sensor_msgs
std_msgs
tf
trajectory_msgs
)
find_package(Boost REQUIRED COMPONENTS chrono thread atomic REQUIRED)
find_package(ypspur 1.17.0 REQUIRED)
###########
## Build ##
###########
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. ")
endif()
include_directories(
include
${catkin_INCLUDE_DIRS}
${ypspur_INCLUDE_DIRS}
)
add_executable(ypspur_ros src/ypspur_ros.cpp)
target_link_libraries(ypspur_ros
${catkin_LIBRARIES}
ypspur
)
add_dependencies(ypspur_ros ${ypspur_ros_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(joint_tf_publisher src/joint_tf_publisher.cpp)
target_link_libraries(joint_tf_publisher ${catkin_LIBRARIES})
add_dependencies(joint_tf_publisher ${ypspur_ros_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(joint_position_to_joint_trajectory src/joint_position_to_joint_trajectory.cpp)
target_link_libraries(joint_position_to_joint_trajectory ${catkin_LIBRARIES})
add_dependencies(joint_position_to_joint_trajectory ${ypspur_ros_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
#############
## Install ##
#############
install(TARGETS
ypspur_ros
joint_tf_publisher
joint_position_to_joint_trajectory
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
#############
## Testing ##
#############
if(CATKIN_ENABLE_TESTING)
add_subdirectory(test)
find_package(roslint REQUIRED)
roslint_cpp()
roslint_add_test()
endif()