티스토리 뷰

Robotics/ROS

CMakeLists.txt

Rocknz 2017. 1. 5. 17:41
Required CMake Version (cmake_minimum_required) : 실행될 cmake의 최소버전 

Package Name (project()) : 실행할 패키지의 이름 package.xml에 있는 이름 그대로씀.

Find other CMake/Catkin packages needed for build (find_package()) : build 할때 필요한 다른 package들을 가지고옴.

다른 package들의 CMake정보를 받아와서 그 패키지들도 실행 시킬 수 있는 환경을 만듬.

catkin을 사용한다면 

find_package(catkin REQUIRED COMPONENTS nodelet)

catkin이 무조건 있어야됨. 

Message/Service/Action Generators(add_message_files(), add_service_files(), add_action_files()) :

사용하는 message 파일, service 파일, action 파일의 추가함.

Invoke message/service/action generation (generate_messages()) :

의존하는 메시지를 사용하겠다고 알려줌.

Specify package build info export (catkin_package()) :

 빌드 시스템의 catkin 의 정보를 구체화 시킨다. 5가지 argument로 나눌수 있는데

add_library()나 add_executable() 전에 실행 되어야한다.

  • INCLUDE_DIRS - 패키지를 위해 포함해야될 경로들을 적어줘야함 (The exported include paths (i.e. cflags) for the package)

  • LIBRARIES - 프로젝트에 필요한 라이브러리를 적어줘야함 ( The exported libraries from the project )

  • CATKIN_DEPENDS -  다른 catkin에 대한 의존성을 적어줘야함 (Other catkin projects that this project depends on)

  • DEPENDS - catkin이 아닌 CMake프로젝트에 대한 의존성을 적어줘야함  (Non-catkin CMake projects that this project depends on)

  • CFG_EXTRAS -  다른 설정옵션들을 적어줘야함 (Additional configuration options)

Libraries/Executables to build (add_library()/add_executable()/target_link_libraries()) :

 add_library : 라이브러리를 가져옴

 add_executable : 실행 파일을 가져옴

 target_link_libraries : 라이브러리와 실행 파일을 연결해줌.

Tests to build (catkin_add_gtest())

 빌드를 하면서 테스팅.

Install rules (install())

  


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함