Ask Your Question
0

Is there a CMakeLists configuration for referencing packages to each other?

asked 2021-06-27 05:42:35 -0500

Kyuhwan Yeon gravatar image

updated 2021-06-27 05:47:22 -0500

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-06-28 02:15:09 -0500

gvdhoorn gravatar image

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

edit flag offensive delete link more

Comments

Thank you. that's correct. the real problem was i tried the circular dependency!. I will reconstruct my packages thank you!

Kyuhwan Yeon gravatar image Kyuhwan Yeon  ( 2021-06-29 08:38:42 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-06-27 05:42:35 -0500

Seen: 19 times

Last updated: Jun 27