質問編集履歴
1
文章の追加
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ros melodicで
|
1
|
+
ros melodicでcatkin_makeができません。
|
test
CHANGED
@@ -66,4 +66,146 @@
|
|
66
66
|
|
67
67
|
|
68
68
|
|
69
|
+
自分のCMakeLists.txtの中身です。
|
70
|
+
|
71
|
+
```
|
72
|
+
|
73
|
+
#toplevel CMakeLists.txt for a catkin workspace
|
74
|
+
|
75
|
+
# catkin/cmake/toplevel.cmake
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
cmake_minimum_required(VERSION 3.0.2)
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
project(Project)
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
set(CATKIN_TOPLEVEL TRUE)
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
# search for catkin within the workspace
|
92
|
+
|
93
|
+
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
|
94
|
+
|
95
|
+
execute_process(COMMAND ${_cmd}
|
96
|
+
|
69
|
-
|
97
|
+
RESULT_VARIABLE _res
|
98
|
+
|
99
|
+
OUTPUT_VARIABLE _out
|
100
|
+
|
101
|
+
ERROR_VARIABLE _err
|
102
|
+
|
103
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
104
|
+
|
105
|
+
ERROR_STRIP_TRAILING_WHITESPACE
|
106
|
+
|
107
|
+
)
|
108
|
+
|
109
|
+
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
|
110
|
+
|
111
|
+
# searching fot catkin resulted in an error
|
112
|
+
|
113
|
+
string(REPLACE ";" " " _cmd_str "${_cmd}")
|
114
|
+
|
115
|
+
message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
|
116
|
+
|
117
|
+
endif()
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
# include catkin from workspace or via find_package()
|
122
|
+
|
123
|
+
if(_res EQUAL 0)
|
124
|
+
|
125
|
+
set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
|
126
|
+
|
127
|
+
# include all.cmake without add_subdirectory to let it operate in same scope
|
128
|
+
|
129
|
+
include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
|
130
|
+
|
131
|
+
add_subdirectory("${_out}")
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
else()
|
136
|
+
|
137
|
+
# use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
|
138
|
+
|
139
|
+
# or CMAKE_PREFIX_PATH from the environment
|
140
|
+
|
141
|
+
if(NOT DEFINED CMAKE_PREFIX_PATH)
|
142
|
+
|
143
|
+
if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
|
144
|
+
|
145
|
+
if(NOT WIN32)
|
146
|
+
|
147
|
+
string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
|
148
|
+
|
149
|
+
else()
|
150
|
+
|
151
|
+
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
|
152
|
+
|
153
|
+
endif()
|
154
|
+
|
155
|
+
endif()
|
156
|
+
|
157
|
+
endif()
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
# list of catkin workspaces
|
162
|
+
|
163
|
+
set(catkin_search_path "")
|
164
|
+
|
165
|
+
foreach(path ${CMAKE_PREFIX_PATH})
|
166
|
+
|
167
|
+
if(EXISTS "${path}/.catkin")
|
168
|
+
|
169
|
+
list(FIND catkin_search_path ${path} _index)
|
170
|
+
|
171
|
+
if(_index EQUAL -1)
|
172
|
+
|
173
|
+
list(APPEND catkin_search_path ${path})
|
174
|
+
|
175
|
+
endif()
|
176
|
+
|
177
|
+
endif()
|
178
|
+
|
179
|
+
endforeach()
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
# search for catkin in all workspaces
|
184
|
+
|
185
|
+
set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
|
186
|
+
|
187
|
+
find_package(catkin QUIET
|
188
|
+
|
189
|
+
NO_POLICY_SCOPE
|
190
|
+
|
191
|
+
PATHS ${catkin_search_path}
|
192
|
+
|
193
|
+
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
194
|
+
|
195
|
+
unset(CATKIN_TOPLEVEL_FIND_PACKAGE)
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
if(NOT catkin_FOUND)
|
200
|
+
|
201
|
+
message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
|
202
|
+
|
203
|
+
endif()
|
204
|
+
|
205
|
+
endif()
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
catkin_workspace()
|
210
|
+
|
211
|
+
```
|