ROS

ROS 사용하면서 .cpp 파일을 링크하고 싶을 때 CMake 수정 방법

ingus kinematics 2023. 1. 2. 19:03

오늘은 CMake를 이용하여 .cpp 확장자 파일을 library화 시켜서 링크하는 방법을 알아보겠습니다.

 

파일 구조가 이런 상황이라고 가정 해봅시다.

 

그러면 add_library 명령어를 이용해서 src 폴더 안에 있는 person_folloing.cpp 파일을 application_library로 변수로 지정하겠다는 의미입니다.

 

그리고나서

target_link_libraries에 application_library를 넣어주면 끝!