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

Revision history [back]

click to hide/show revision 1
initial version

The shown warning has nothing to do with CMP0048.

It would be helpful if you would either share the content of your CMakeLists.txt as part of the question or reference the file in a public repository.

The warning literally mentions what the problem in the CMakeLists.txt of your package is and how you should be able to resolve it:

No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

The shown warning has nothing to do with CMP0048.

It would be helpful if you would either share the content of your CMakeLists.txt as part of the question or reference the file in a public repository.

The warning literally mentions what the problem in the CMakeLists.txt of (of your package package) is and how you should be able to resolve it:

No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

Update:

The warning is being generated from to the top-level CMakeLists.txt file when using catkin_make with CMake 3.15 or newer.

You can either:

  • use catkin_make_isolated instead of catkin_make (which doesn't use a top-level CMake file,
  • apply the patch from https://github.com/ros/catkin/pull/1106 locally to the file /opt/ros/noetic/share/catkin/cmake/toplevel.cmake manually, or
  • wait for a new version of catkin to be released with the referenced patch.