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

How to fix unstable build on buildfarm for noetic because of CMP0048?

asked 2020-09-04 12:40:46 -0600

rreignier gravatar image

updated 2020-09-04 12:41:16 -0600

I have just released my package on Neotic and the buildfarm reports an unstable build on Ndev_* because of CMake warning CMP0048 than means that VERSION is not provided in the project().

From the console output:

16:09:34 CMake Warning (dev) at CMakeLists.txt:2 (project):
16:09:34   Policy CMP0048 is not set: project() command manages VERSION variables.
16:09:34   Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
16:09:34   command to set the policy and suppress this warning.
16:09:34 
16:09:34   The following variable(s) would be set to empty:
16:09:34 
16:09:34     CMAKE_PROJECT_VERSION
16:09:34     CMAKE_PROJECT_VERSION_MAJOR
16:09:34     CMAKE_PROJECT_VERSION_MINOR
16:09:34     CMAKE_PROJECT_VERSION_PATCH
16:09:34 This warning is for project developers.  Use -Wno-dev to suppress it.

I have checked other ROS packages and they don't seem to provide a version in their CMakeLists.txt nor set the CMP0048 policy explicitly.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
7

answered 2020-09-04 12:44:32 -0600

Dirk Thomas gravatar image

To avoid the warning with newer CMake versions you want to bump the minimum CMake version declared in the package. ROS packages for active distros use the following:

cmake_minimum_required(VERSION 3.0.2)
edit flag offensive delete link more

Comments

Great, thank you!

rreignier gravatar image rreignier  ( 2020-09-04 13:22:00 -0600 )edit

Yes this works, but I am getting an error if I am using 3.0.2 with meta packages

Markus Bader gravatar image Markus Bader  ( 2020-12-18 16:01:46 -0600 )edit

If you're getting an error due to metapackages, it means the version of catkin_pkg is too old. Upgrade that sudo apt upgrade python3-catkin-pkg. You need at least version 0.4.16 so it has this fix: https://github.com/ros-infrastructure...

sloretz gravatar image sloretz  ( 2020-12-18 16:10:18 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-09-04 12:40:46 -0600

Seen: 2,207 times

Last updated: Sep 04 '20