CMake Upgrade for ROS Melodic in Ubuntu 18.04 [closed]
Hello Everyone,
In my ROS project I want to use a C++ library written by myself. This library builds with CMake itself and use the FetchContent module which was introduced in CMake version 3.11.
I intended to integrate the library in my package using FetchContent module as well and made necessary changes in the CMakeLists.txt file in package. At that point I was running CMake version 3.10 in ubuntu and naturally catkin_make failed.
I followed the steps described in this thread in order to upgrade my CMake version
https://answers.ros.org/question/2931...
in order to upgrade my CMake without removing the existing one. It worked. Now upon running cmake --version I have the following outcome.
cmake version 3.13.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).
I also added the following lines in .bashrc as per the upgrade suggestions
export PATH=$HOME/cmake-install/bin:$PATH
export CMAKE_PREFIX_PATH=$HOME/cmake-install:$CMAKE_PREFIX_PATH
I have also verified the installation by creating separate test CMake build with cmake_minimum_required(VERSION 3.13)
and using FetchContent
module. And the version upgrade was successful.
However, upon running catkin_make in my workspace, I still see the following failure
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - my_package
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-- +++ processing catkin package: 'my_package'
-- ==> add_subdirectory(my_package)
CMake Error at my_package/CMakeLists.txt:1 (cmake_minimum_required): CMake 3.13 or higher is required. You are running version 3.10.2
I am not being able to troubleshoot that, despite upgrading to CMake version 3.13 successfully, why catkin is still referring to the older version.
I am new to ROS. Could anyone please suggest me any troubleshooting steps ?
Thanks & Cheers,
Chandan Sarkar