相关文章推荐
近视的豆浆  ·  angular - Argument of ...·  1 年前    · 
魁梧的小刀  ·  C++ string vector ...·  1 年前    · 
温柔的酱牛肉  ·  解决: Incorrect ...·  1 年前    · 

1. find_package(catkin)

find_package(catkin REQUIRED COMPONENTS
gflags_catkin
glog_catkin
opencv3_catkin
)
catkin_package()
找的是 /opt/ros/melodic/share/catkin/cmake/ 下的 catkinConfig.cmake

可以在里面打印一些信息

if(catkin_FIND_COMPONENTS)
  foreach(component ${catkin_FIND_COMPONENTS})
    string(TOLOWER "${component}" component_lower)
    # skip catkin since it does not make sense as a component
    if(NOT ${component_lower} STREQUAL "catkin")
      # get search paths from CMAKE_PREFIX_PATH (which includes devel space)
      set(paths "")
      foreach(path ${CMAKE_PREFIX_PATH})
        if(IS_DIRECTORY ${path}/share/${component}/cmake)
          list(APPEND paths ${path}/share/${component}/cmake)
        endif()
      endforeach()
      message("chenjun: ${paths}")					# 可以打印cmake的路径
      # find package component
      if(catkin_FIND_REQUIRED)
        # try without REQUIRED first
        find_package(${component} NO_MODULE PATHS ${paths}
          NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)

2. catkin包

catkin的包,在cmake文件夹下有package-extras.cmake.in的模板。在里面设定每个catkin包的头文件和动态库。不然上面的find_package(catkin)是无法包含库的头文件和动态库的。

# This overrides the dependency tracker with the GLOG library file.
set(@PROJECT_NAME@_LIBRARIES 
  @CATKIN_DEVEL_PREFIX@/lib/libglog${CMAKE_SHARED_LIBRARY_SUFFIX})
set(@PROJECT_NAME@_INCLUDE_DIR @CATKIN_DEVEL_PREFIX@/include)

3. 辅助信息变量

  • ${opencv3_catkin_LIBRARIES}:具体catkin包的动态库
  • ${catkin_INCLUDE_DIRS}:所有catkin包的头文件
  • ${catkin_LIBRARIES}:所有catkin包的动态库
catkin1. find_package(catkin)find_package(catkin REQUIRED COMPONENTSgflags_catkinglog_catkinopencv3_catkin)catkin_package()找的是/opt/ros/melodic/share/catkin/cmake/下的catkinConfig.cmake可以在里面打印一些信息if(catkin_FIND_COMPONENTS) foreach(component ${ca.
[小白笔记0]ROS配置环境的问题find_package find_package(catkin REQUIRED COMPONENTS message_generation roscpp rosconsole sensor_msgs cmake_modules REQUIRED Eigen3 REQUIRED find_package(OpenCV REQUIRED) 当我把OpenCV ...
今天catkin build 整个工程,编译catkin_tools_prebuild时遇到失败的情况,如下: The catkin CMake module was not found, but it is required to build a linked workspace. To resolve this, please do one of the following, and ...
catkin_package与find_packagehttps://cloud.tencent.com/developer/ask/183702 ROS Catkin 教程之 catkin_package(...) 到底在做什么?https://blog.csdn.net/lcc816/article/details/82962561 https://answers.ros.org/quest...
(3)add_executable( src1 src2 ...) (简易写法) (4)target_link_libraries( lib1 lib2 ...) (简易写法,lib是依赖库的路径) 重点的命令总结: ...
While looking at a CMakeLists.txt file, I was wondering the exact meaning of the CATKIN_DEPENDS option of the catkin_package(...) macro was. I would expect to see there the same packages as listed in ...
1.错误:在catkin build cv_bridge这步时,遇到错误 CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "opencv3_catkin" with any of the following names: opencv3_catkin...
CMake Error at cmake/OpenCVCompilerOptions.cmake:21 (else): Flow control statements are not properly nested. 打开对应的cmake文件21行发现同一个作用域有两个else 21行22行注释掉就可以了 别的电脑也编译过貌似没出现过这种问题,应该与cmake版本有关 voxblox++是2019年ETHZ的RAL论文Volumetric Instance-Aware Semantic Mapping and 3D Object Discovery所提出的全景建图算法,是在voxblox基础上改进的,增加了实例和语义信息。因为感觉效果不错,所以想复现一下看看能不能作为之后工作的基础。 基本上是参考着官方教程来的 官方安装编译教程 官方运行教程 还有这一篇博客是找到的唯一一个介绍了编译过程的,很多东西都用到了他的,非常感谢 参考编译教程 大环境准备 catkin编译过程: 1.查找workspace(catkin_ws)下的src的package 2. catkin编译系统依据 Cmakelists.txt 和 package.xml 文件,生成 makefiles(catkin_ws/build/) 3. make makefiles文件,生成可执行文件 (放在catkin_ws/devel中) cakin 相当于cmake 和 make 的封装完成编译的工具 命令:catkin_make mkdir -p ~/catk
ROS 功能的 CMakeLists.txt 文件中有这样两个宏,catkin_package 与 find_package。例如它们具有以下内容: find_package(catkin REQUIRED COMPONENTS roscpp actionlib std_msgs message_generation actionlib_msgs 注释:这一点与Python很像都是使用“#”作为注释符 变量:在CMake中变量的定义有些特别,一般用set命令作为显式定义和变量的赋值。注意:如果在if语句中使用到变量时可以直接使用变量名,如果不是在if语句中使用的话则需要使用${}来引用变量。 调用命令:命令不分大小写,参数使用空格分隔,如果参数中出现空格则需要用双引号含起来 package....