CMake Error at CMakeLists.txt:1:

Parse error. Expected a command name, got unquoted argument with text "/opt/ros/melodic/share/catkin/cmake/toplevel.cmake".

查了好多资料和解决方案(例如查看是否有空格、设置为utf-8 nobomb之类的)但都解决不了

很奇怪啊,如果说这个文件有问题的话,那以前用ros和gazebo仿真的时候怎么没报错呢