程序在cmake编译是这样的流程, cmake指令依据你的CMakeLists.txt 文件,生成makefiles文件,make再依据此makefiles文件编译链接生成可执行文件. catkin_make是将cmake与make的编译方式做了一个封装的指令工具, 规范了工作路径与生成文件路径.
1) cmake标准流程
1. # 在一个CMake项目里2. $ mkdir build3. $ cd build4. $ cmake ..5. $ make6. $ make install # (可选)
2) catkin_make 的流程
1. # In a catkin workspace2. $ catkin_make3. $ catkin_make install # (可选)4. 5. 6. 如果源码不在默认工作空间,需要指定编译路径:7. 8. # In a catkin workspace9. $ catkin_make --source my_src10. $ catkin_make install --source my_src # (optionally)
3、catkin_make默认的路径信息
1. 在catkin_make运行后终端输出文件部分解析2. 3. #基本路径4. Base path: /home/user/catkin_ws5. Source space: /home/user/catkin_ws/src6. Build space: /home/user/catkin_ws/build7. Devel space: /home/user/catkin_ws/devel8. Install space: /home/user/catkin_ws/install9. 10. 11. #catkin_make 封装运行中cmake运行的情况12. Running command: "cmake /home/user/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/user/catkin_ws/devel 13. -DCMAKE_INSTALL_PREFIX=/home/user/catkin_ws/install" in "/home/user/catkin_ws/build"14. 15. #编译工具查找16. -- Using CATKIN_DEVEL_PREFIX: /tmp/catkin_ws/devel17. -- Using CMAKE_PREFIX_PATH: /opt/ros/groovy18. -- This workspace overlays: /opt/ros/groovy19. 20. #编译的包21. <pre name="code" class="cpp">#catkin_make 封装运行中make运行的情况