您的CMakeLists.txt文件必须遵循此格式,否则您的软件包将无法正确构建。 配置中的顺序很重要。
-
Required CMake Version (cmake_minimum_required)
-
Package Name (project())
-
Find other CMake/Catkin packages needed for build (find_package())
-
Enable Python module support (catkin_python_setup())
-
Message/Service/Action Generators (add_message_files(), add_service_files(), add_action_files())
-
Invoke message/service/action generation (generate_messages())
-
Specify package build info export (catkin_package())
-
Libraries/Executables to build (add_library()/add_executable()/target_link_libraries())
-
Tests to build (catkin_add_gtest())
-
Install rules (install())
官网教程:
博客文章