Curieux.JY
  • JungYeon Lee
  • Post
  • ๐Ÿ•ธ๏ธ Graph
  • Lecture
  • Note

On this page

  • Issue
  • Solution
  • Related

๐Ÿ“ROS2 Build Issue

ros2
build
2025
ROS2 Issue Tracker
Published

January 13, 2025

Issue

Error Message

CMake Error at CMakeLists.txt:5 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake" with
  any of the following names:

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

  Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" to a directory containing one of the above files.  If
  "ament_cmake" provides a separate development package or SDK, be sure it
  has been installed.

Solution

This error typically appears when CMake cannot locate ament_cmake. In ROS 2, ament_cmake is a core build system package that you must have installed (and sourced) before building any ament-based packages.

Ensure the ament_cmake package is actually installed. On Ubuntu, for Humble, youโ€™d expect something like:

If you have a minimal or custom ROS 2 installation, you might need to install additional packages to get ament_cmake.

sudo apt-get install ros-humble-ament-cmake

Related

find_package ๋‹จ๊ณ„์—์„œ ๊นจ์ง€๋Š” ๋‹ค๋ฅธ ์‚ฌ๋ก€๋กœ, CMake์˜ FindPython3๊ฐ€ ์‹œ์Šคํ…œ ์ธํ„ฐํ”„๋ฆฌํ„ฐ ๋Œ€์‹  ~/.local/bin์˜ ๋‹ค๋ฅธ ํŒŒ์ด์ฌ์„ ์žก์•„ ModuleNotFoundError: No module named 'catkin_pkg'๊ฐ€ ๋‚˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ํ•ด๊ฒฐ์€ ROS 2 ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ์‹ค์ธก ๋…ธํŠธ์˜ ์žฌํ˜„ ๋ฉ”๋ชจ ์ฐธ๊ณ .

colcon build --symlink-install --cmake-args -DPython3_EXECUTABLE=/usr/bin/python3

Copyright 2026, JungYeon Lee