質問編集履歴
1
文章の追加
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
ros melodicで
|
1
|
+
ros melodicでcatkin_makeができません。
|
body
CHANGED
@@ -32,4 +32,75 @@
|
|
32
32
|
ros melodic
|
33
33
|
Ubuntu 18.04
|
34
34
|
|
35
|
+
自分のCMakeLists.txtの中身です。
|
36
|
+
```
|
37
|
+
#toplevel CMakeLists.txt for a catkin workspace
|
38
|
+
# catkin/cmake/toplevel.cmake
|
39
|
+
|
40
|
+
cmake_minimum_required(VERSION 3.0.2)
|
41
|
+
|
42
|
+
project(Project)
|
43
|
+
|
44
|
+
set(CATKIN_TOPLEVEL TRUE)
|
45
|
+
|
46
|
+
# search for catkin within the workspace
|
47
|
+
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
|
48
|
+
execute_process(COMMAND ${_cmd}
|
35
|
-
|
49
|
+
RESULT_VARIABLE _res
|
50
|
+
OUTPUT_VARIABLE _out
|
51
|
+
ERROR_VARIABLE _err
|
52
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
53
|
+
ERROR_STRIP_TRAILING_WHITESPACE
|
54
|
+
)
|
55
|
+
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
|
56
|
+
# searching fot catkin resulted in an error
|
57
|
+
string(REPLACE ";" " " _cmd_str "${_cmd}")
|
58
|
+
message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
|
59
|
+
endif()
|
60
|
+
|
61
|
+
# include catkin from workspace or via find_package()
|
62
|
+
if(_res EQUAL 0)
|
63
|
+
set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
|
64
|
+
# include all.cmake without add_subdirectory to let it operate in same scope
|
65
|
+
include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
|
66
|
+
add_subdirectory("${_out}")
|
67
|
+
|
68
|
+
else()
|
69
|
+
# use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
|
70
|
+
# or CMAKE_PREFIX_PATH from the environment
|
71
|
+
if(NOT DEFINED CMAKE_PREFIX_PATH)
|
72
|
+
if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
|
73
|
+
if(NOT WIN32)
|
74
|
+
string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
|
75
|
+
else()
|
76
|
+
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
|
77
|
+
endif()
|
78
|
+
endif()
|
79
|
+
endif()
|
80
|
+
|
81
|
+
# list of catkin workspaces
|
82
|
+
set(catkin_search_path "")
|
83
|
+
foreach(path ${CMAKE_PREFIX_PATH})
|
84
|
+
if(EXISTS "${path}/.catkin")
|
85
|
+
list(FIND catkin_search_path ${path} _index)
|
86
|
+
if(_index EQUAL -1)
|
87
|
+
list(APPEND catkin_search_path ${path})
|
88
|
+
endif()
|
89
|
+
endif()
|
90
|
+
endforeach()
|
91
|
+
|
92
|
+
# search for catkin in all workspaces
|
93
|
+
set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
|
94
|
+
find_package(catkin QUIET
|
95
|
+
NO_POLICY_SCOPE
|
96
|
+
PATHS ${catkin_search_path}
|
97
|
+
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
98
|
+
unset(CATKIN_TOPLEVEL_FIND_PACKAGE)
|
99
|
+
|
100
|
+
if(NOT catkin_FOUND)
|
101
|
+
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.")
|
102
|
+
endif()
|
103
|
+
endif()
|
104
|
+
|
105
|
+
catkin_workspace()
|
106
|
+
```
|