cmake_minimum_required(VERSION 2.8.3)
project(lidar_segment_ground)
#设置工程名称
set(APP_NAME lidar_segment_ground)
add_compile_options(-std=c++14)
set(CMAKE_BUILD_TYPE Release)
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
find_package(PCL REQUIRED)
find_package(roscpp REQUIRED)
#工程头文件PROJECT_SOURCE_DIR工程根目录
include_directories(s
include
${PROJECT_SOURCE_DIR}/..
${PROJECT_SOURCE_DIR}/src/..
../devel/include/msgs
)
#第三方库头文件
include_directories(
${PCL_INCLUDE_DIRS}
${roscpp_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/../../message/ros/devel/include
/usr/local/include/
)
#第三方库lib
link_directories(
${PCL_LIBRARIES}
)
#将源文件所有的cpp做管理直接在链接时使用
FILE(GLOB_RECURSE SOURCE_FILES src/*.c* src/*.h*)
add_executable(${APP_NAME} ${SOURCE_FILES})
#动态库
target_link_libraries(${APP_NAME}
${PCL_LIBRARIES}
${roscpp_LIBRARIES}
)
#设置程序生成位置
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
cmake.txt标准模板
最新推荐文章于 2024-08-24 15:46:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)