catkin build fails after upgrading ROS distro
Recently I upgraded my Ubuntu from 16.04 to 18.04, thus I reinstalled ROS Melodic after uninstalling Kinetic.
roscore and some other basic ROS packages work fine, however when I try to build my workspace with catkin build
following error message appears:
CMake Error at /home/user1/projects/catkin_ws/src/custom_package/CMakeLists.txt:10 (find_package):
By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "catkin", but
CMake did not find one.
Could not find a package configuration file provided by "catkin" with any
of the following names:
catkinConfig.cmake
catkin-config.cmake
Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
"catkin_DIR" to a directory containing one of the above files. If "catkin"
provides a separate development package or SDK, be sure it has been
installed.
make: *** [cmake_check_build_system] Error 1
The package and workspace was working fine before (on another melodic machine). I tested to create a new empty workspace with catkin init
but catkin build
still throws the same error message.
I also did source /opt/ros/melodic/setup.bash
. My cmake version is 3.10.2
Anyone knows how to solve this? Many thanks!