【发布时间】:2021-06-27 10:25:27
【问题描述】:
当我catkin_makemodule_one找到包module_two和module_two找到包module_one时,出现如下错误
-- +++ processing catkin package: 'module_one'
-- ==> add_subdirectory(module_one)
-- Could NOT find module_two (missing: module_two_DIR)
-- Could not find the required component 'module_two'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "module_two" with
any of the following names:
module_twoConfig.cmake
module_two-config.cmake
Add the installation prefix of "module_two" to CMAKE_PREFIX_PATH or set
"module_two_DIR" to a directory containing one of the above files. If
"module_two" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
module_one/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/ri/workspace/catkin_playground/build/CMakeFiles/CMakeOutput.log".
See also "/home/ri/workspace/catkin_playground/build/CMakeFiles/CMakeError.log".
工作区文件夹树在下面
├── build
│ ├── atomic_configure
│ ├── catkin
│ │ └── catkin_generated
│ │ └── version
│ ├── catkin_generated
│ │ ├── installspace
│ │ └── stamps
│ │ └── Project
│ ├── CMakeFiles
│ │ ├── 3.11.0
│ │ │ ├── CompilerIdC
│ │ │ │ └── tmp
│ │ │ └── CompilerIdCXX
│ │ │ └── tmp
│ │ └── CMakeTmp
│ ├── gtest
│ │ ├── CMakeFiles
│ │ └── googlemock
│ │ ├── CMakeFiles
│ │ └── gtest
│ │ └── CMakeFiles
│ ├── module_one
│ │ └── CMakeFiles
│ └── test_results
├── devel
│ └── lib
└── src
├── module_one
└── module_two
module_one 的 CMakeLists.txt 有
find_package(catkin REQUIRED module_two)
module_two 的 CMakeLists.txt 有
find_package(catkin REQUIRED module_one)
像上面的项目,
是否有用于相互引用包的 CMakeLists 配置?
【问题讨论】:
-
不确定,但是否可以将
catkin放入一些module3,然后使module1和module2在module3中查找包?