CMakeLists 使用pcl
时间: 2023-10-26 07:05:16 浏览: 37
如果你想在你的 CMake 项目中使用 PCL(Point Cloud Library),你需要在你的 CMakeLists.txt 文件中添加以下内容:
```
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(your_project_name)
# Find the PCL library
find_package(PCL 1.2 REQUIRED)
# Include directories
include_directories(${PCL_INCLUDE_DIRS})
# Link directories
link_directories(${PCL_LIBRARY_DIRS})
# Add definitions
add_definitions(${PCL_DEFINITIONS})
# Add your executable
add_executable(your_executable_name your_code.cpp)
# Link your executable with PCL libraries
target_link_libraries(your_executable_name ${PCL_LIBRARIES})
```
在这个例子中,我们假设你的项目名称为 `your_project_name`,你的源代码文件名为 `your_code.cpp`,你的可执行文件名为 `your_executable_name`。
当你运行 CMake 时,它应该能够找到 PCL 库,并将其链接到你的可执行文件中。