By not providing “Findcatkin.cmake“ in CMAKE_MODULE_PATH this project has asked CMake to find a pa

See also "/tmp/QtCreator-XzPzFL/qtc-cmake-iCElsmaa/CMakeFiles/CMakeOutput.log".
CMake Project parsing failed.
Starting to parse CMake project, using: "-DCMAKE_BUILD_TYPE:STRING=Debug", "-DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++", "-DCMAKE_C_COMPILER:STRING=/usr/bin/gcc", "-DCMAKE_PREFIX_PATH:STRING=", "-DQT_QMAKE_EXECUTABLE:STRING=".
CMake Error at CMakeLists.txt:17 (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.

找不到 catkinConfig.cmake文件,缺少路径,在相应cmakelist文件中,添加

set(catkin_DIR /opt/ros/melodic/share/catkin/cmake) #DIR后面是catkinconfig路径
find_package(catkin REQUIRED)
include_directories(${catkin_DIR})

参考 https://stackoverflow.com/questions/33454649/cmake-error-at-cmakelists-txt3-find-package


版权声明:本文为weixin_44057437原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。