PCL在ROS中的CMakeLists.txt

时间:2024-02-23 15:18:00
cmake_minimum_required(VERSION 3.1) project(pose_tracker) ## Compile as C++11, supported in ROS Kinetic and newer #add_compile_options(-std=c++11) add_compile_options(-std=c++14) #set(CMAKE_CXX_FLAGS "-std=c++11 -03") #set(CMAKE_CXX_STANDARD 14) #set(CMAKE_CXX_STANDARD_REQUIRED ON) #set(CMAKE_CXX_EXTENSIONS OFF) #fastdeploy set(FASTDEPLOY_INSTALL_DIR /root/FastDeploy/build/installed_fastdeploy) include(${FASTDEPLOY_INSTALL_DIR}/FastDeploy.cmake) message(STATUS "FASTDEPLOY_LIBS path: " ${FASTDEPLOY_LIBS}) find_package(OpenCV 4.2 EXACT) message(STATUS "Opencv include path: " ${OpenCV_INCLUDE_DIRS}) message(STATUS "Opencv lib path: " ${OpenCV_LIBRARIES}) find_package(PCL 1.10 REQUIRED) include_directories(${PCL_INCLUDE_DIRS}) link_directories(${PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS}) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages find_package(catkin REQUIRED COMPONENTS cv_bridge eigen_conversions geometry_msgs image_transport message_generation roscpp sensor_msgs nav_msgs std_msgs pcl_conversions pcl_ros ) catkin_package( INCLUDE_DIRS include LIBRARIES pose_tracker CATKIN_DEPENDS cv_bridge eigen_conversions geometry_msgs image_transport message_generation roscpp sensor_msgs nav_msgs std_msgs pcl_conversions pcl_ros DEPENDS PCL ) ########### ## Build ## ########### ## Specify additional locations of header files ## Your package locations should be listed before other locations include_directories( include ${catkin_INCLUDE_DIRS} ${FASTDEPLOY_INCS} ${OpenCV_INCLUDE_DIRS} /usr/include/eigen3 /usr/include /usr/local/include ${PCL_INCLUDE_DIRS} ) file(GLOB SOURCE_FILES src/*.cpp) add_executable(${PROJECT_NAME}_node ${SOURCE_FILES}) target_include_directories(${PROJECT_NAME}_node PRIVATE include ${CATKIN_DEVEL_PREFIX}/include/ ${FASTDEPLOY_INSTALL_DIR}/incldue/ ) ## Specify libraries to link a library or executable target against target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} ${FASTDEPLOY_LIBS} ${OpenCV_LIBRARIES} ${FASTDEPLOY_INSTALL_DIR}/lib ${PCL_LIBRARIES} )

相关文章