ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

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:

cmake_modulesConfig.cmake
cmake_modules-config.cmake

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)
project(foobar)
find_package(catkin REQUIRED)
find_package(cmake_modules REQUIRED)
catkin_package(
  LIBRARIES ${PROJECT_NAME}
  INCLUDE_DIRS inc
)
...

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

<?xml version="1.0"?>
<package format="2">
  <name>foobar</name>
  <version>1.1.0</version>
  <description>The FooBar Thinger</description>
  <author email="author@foobar.com">author person</author>
  <maintainer email="maintainer@foobar.com">maintainer person</maintainer>
  <license>GPL</license>
  <url type="website">http://foobar.com</url>
  <url type="repository">https://github.com/foobar/foobar</url>
  <build_depend>cmake_modules</build_depend>
  <buildtool_depend>catkin</buildtool_depend>
</package>

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
1

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
3

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

Comments

@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
1

@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

Question Tools

3 followers

Stats

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

Seen: 3,801 times

Last updated: Nov 05 '19