Robotics StackExchange | Archived questions

Colcon build fails, cmake_minimum_required

Hi,

For a school project I need to use a provided ROS2 workspace, wich contains 2 packages. Both packages have cmake_minimum_required(VERSION 3.18) statement on top of the CMakeLists.txt. I installed cmake version 3.25.1using snap. I also installed colcon using this command : sudo apt install python3-colcon-common-extensions.

When I run colcon build on the root of the workspace, I get the error : CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.18 or higher is required. You are running version 3.16.3, but when in my terminal I run cmake --version, I get : cmake version 3.25.1

I'm pretty new to ROS, maybe I missing something, thanks for your help.

P.S.: I'm using ROS2 Galactic and I'm working on ubuntu 20.04

Asked by antoniopisanell on 2022-12-15 05:26:04 UTC

Comments

Answers

I'm not sure about how snap works, but in general I would strongly advise against using two different package managers on your system, in your case you are using both apt and snap. These kinds of problems typically arise from there not being one singular cmake installed on your system, but two.

I would recommend uninstalling cmake via snap and following this guide for getting a proper upgraded version of cmake in your system.

Asked by Per Edwardsson on 2022-12-15 09:20:05 UTC

Comments