How to fix a corrupted (boilerplate) toplevel.cmake file?
I accidentally replaced my CMakeLists.txt file in my catkin_ws/src directory and then ran catkin_make. This replaced the toplevel.cmake
located in this directory /opt/ros/indigo/share/catkin/cmake
. Resulting in the following error:
CMake Error: File /home/user/projects/catkin_ws/src/package.xml does not exist.
CMake Error at /opt/ros/indigo/share/catkin/cmake/stamp.cmake:10 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/opt/ros/indigo/share/catkin/cmake/catkin_package_xml.cmake:61 (stamp)
/opt/ros/indigo/share/catkin/cmake/catkin_package_xml.cmake:39 (_catkin_package_xml)
/opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:95 (catkin_package_xml)
CMakeLists.txt:37 (catkin_package)
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:112 (message):
catkin_package() 'catkin' must be listed as a buildtool dependency in the
package.xml
Call Stack (most recent call first):
/opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:98 (_catkin_package)
CMakeLists.txt:37 (catkin_package)
This is the same question asked here, however I'm not able to follow the answer given. I tried of replacing the toplevel.cmake
located in the directory the /opt/ros/indigo/share/catkin/cmake
, however I couldn't find the original one (or how to generate it again).
To be more specific, I would like to know what the best way to proceed is (should I reinstall ROS or is there a better solution?).
For future questions: please use the Preformatted text button (the one with
101010
on it) for console copy/pastes instead of Block quote. As the name suggests, it preserves the formatting better (Block quote rearranges things in sometimes unpredictable ways).