-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
97 lines (87 loc) · 2.69 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
cmake_minimum_required(VERSION 3.0.2)
########################################################################################################################
# Metadata
########################################################################################################################
# Read the package manifest.
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/package.xml" package_xml_str)
# Extract project name.
if(NOT package_xml_str MATCHES "<name>([A-Za-z0-9_]+)</name>")
message(FATAL_ERROR "Could not parse project name from package manifest (aborting)")
else()
set(extracted_name ${CMAKE_MATCH_1})
endif()
# Extract project version.
if(NOT package_xml_str MATCHES "<version>([0-9]+.[0-9]+.[0-9]+)</version>")
message(FATAL_ERROR "Could not parse project version from package manifest (aborting)")
else()
set(extracted_version ${CMAKE_MATCH_1})
endif()
########################################################################################################################
# CMake project
########################################################################################################################
project(${extracted_name} VERSION ${extracted_version})
#===========================================================
# Dependencies
#===========================================================
#-----------------------------
# Catkin packages
#-----------------------------
find_package(catkin
REQUIRED COMPONENTS
message_generation
std_msgs
)
#===========================================================
# Generate ROS interfaces
#===========================================================
add_message_files(
FILES
MechanicalUnitState.msg
RAPIDSymbolPath.msg
RAPIDTaskState.msg
ServiceResponses.msg
SystemState.msg
)
add_service_files(
FILES
GetFileContents.srv
GetIOSignal.srv
GetRAPIDBool.srv
GetRAPIDDnum.srv
GetRAPIDNum.srv
GetRAPIDString.srv
GetRAPIDSymbol.srv
GetRobotControllerDescription.srv
GetSpeedRatio.srv
SetFileContents.srv
SetIOSignal.srv
SetRAPIDBool.srv
SetRAPIDDnum.srv
SetRAPIDNum.srv
SetRAPIDString.srv
SetRAPIDSymbol.srv
SetSpeedRatio.srv
TriggerWithResultCode.srv
)
generate_messages(
DEPENDENCIES
std_msgs
)
#===========================================================
# Catkin package specific configurations
#===========================================================
catkin_package(
CATKIN_DEPENDS
message_runtime
std_msgs
)
#===========================================================
# Install additional files
#===========================================================
install(
FILES
LICENSE
README.md
DESTINATION
${CATKIN_PACKAGE_SHARE_DESTINATION}
)