For example,you may find that after the number of Apple shares soared,the price fluctuated rapidly.Therefore,you have built a program to find this pattern in Apple’s entire market history.
cmake_minimum_required(VERSION 2.8)
project(rgbd-slam-tutor2)
#设置用 debug 还是 release 模式。debug 允许断点,而 release 更快
#set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE Release)
#设置编译选项
#允许 c++11 标准、O3 优化、多线程。match 选项可避免一些 cpu 上的问题
set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS}-std=c++11-march=native-O3-pthread")
#常见依赖库:cv,eigen,pcl
find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(PCL 1.7 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
#二进制文件输出到 bin
set(EXECUTABLE_OUTPUT_PATH${PROJECT_SOURCE_DIR}/bin)
#库输出到 lib
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY${PROJECT_SOURCE_DIR}/lib)
#头文件目录
include_directories(
${PROJECT_SOURCE_DIR}/include
)
#源文件目录
add_subdirectory(${PROJECT_SOURCE_DIR}/src/)