ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

cmake error find_package cmake_modules

asked 2019-10-27 11:36:57 -0500

rubicks gravatar image

updated 2019-11-05 11:03:12 -0500

gvdhoorn gravatar image

Some time in the last 24 hours (2019.10.27), the ROS apt repositories started publishing the following:

  • python-catkin-pkg-modules (0.4.14-1)
  • python-catkin-pkg (0.4.14-100)

Right around that time, fully _all_ of my CMakeLists.txt started producing errors of the following form:

CMake Error at /home/luser/copy_catkin_ws/src/foobar/CMakeLists.txt:5 (find_package) Failed << robot_models:cmake [ Exited with code 1 ]
: By not providing "Findcmake_modules.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "cmake_modules", but CMake did not find one.

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


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

-- Configuring incomplete, errors occurred!

I'm guessing it has something to do with the manner by which I'm invoking find_package(catkin) and/or find_package(cmake_modules). Here's what was working right up until yesterday:

cmake_minimum_required(VERSION 3.5)
find_package(catkin REQUIRED)
find_package(cmake_modules REQUIRED)

Here's what the associated package.xml looks like:

<?xml version="1.0"?>
<package format="2">
  <description>The FooBar Thinger</description>
  <author email="">author person</author>
  <maintainer email="">maintainer person</maintainer>
  <url type="website"></url>
  <url type="repository"></url>

Anybody know what happened on 2019.10.26 regarding python-catkin-pkg-modules and python-catkin-pkg? I'm willing to believe I was laboring all along with broken CMakeLists.txt and/or package.xml, but I would like to understand what happened.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-11-05 09:45:19 -0500

rubicks gravatar image

Okay, this one is on me. Until recently, in my build environment, just after I ran rosdep against the package.xmls in my source space and just before I ran $ catkin config --install && catkin build, I did a # apt purge --yes sudo. This ~is~ was fine, so long as sudo was never an (eventual) build-time dependency. On 2019.10.26, that all changed and, for the first time, removing sudo from the set of installed packages caused ros-cmake-modules to be removed along with it. I've since stopped twiddling packages between the invocation of rosdep and the build proper.

edit flag offensive delete link more

answered 2019-11-04 11:35:33 -0500

Dirk Thomas gravatar image

The updated python-catkin-pkg[-modules] packages have nothing to do with the above error message.

The error message indicates that you either don't have ros-<distro>-cmake-modules installed or haven't sourced /opt/ros/<distro>/setup.<shell>.

edit flag offensive delete link more


@dirk-thomas, you're absolutely correct; thank you for your reply. I've amended my original question with an update explaining my particular situation, how that contributed to the problem, and how I've addressed it. Sorry for the distraction.

rubicks gravatar image rubicks  ( 2019-11-04 16:31:15 -0500 )edit

@rubicks: as helpful as @Dirk Thomas' comment is, it's not the answer.

Your edit is the answer, as that explains what caused your problems.

My suggestion would be to post your edit as an answer and accept your own answer. That would clearly show what the cause was and how you fixed things.

gvdhoorn gravatar image gvdhoorn  ( 2019-11-05 01:30:33 -0500 )edit

@gvdhoorn , done and done; thanks for the help.

rubicks gravatar image rubicks  ( 2019-11-05 09:45:59 -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



Asked: 2019-10-27 11:36:57 -0500

Seen: 3,219 times

Last updated: Nov 05 '19