0
$\begingroup$

Rosanswers logo

ROS: melodic
Linux: 18.04

When i catkin_make when module_one find package module_two and module_two find package module_one, there is error like below

-- +++ 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".

the workspace folder tree is below

├── 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 and module_two are pacakage individually.

module_one's CMakeLists.txt has

find_package(catkin REQUIRED module_two)  

module_two's CMakeLists.txt has

find_package(catkin REQUIRED module_one)  

like the above project,
Is there a CMakeLists configuration for referencing packages to each other?


Originally posted by Kyuhwan Yeon on ROS Answers with karma: 23 on 2021-06-27

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Regardless of the error you mention, two CMake packages cannot depend on each other directly. Circular dependencies are unsupported.


Originally posted by gvdhoorn with karma: 86574 on 2021-06-28

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Kyuhwan Yeon on 2021-06-29:
Thank you. that's correct. the real problem was i tried the circular dependency!. I will reconstruct my packages thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.