环境:vs2017
1.写cmakelist.txt:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(Measure)
#pcl
find_package(PCL 1.8.1 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (Measure affine.cpp)
#opencv
#find_package(OpenCV REQUIRED)
set(OpenCV_DIR E:\\opencv\\build)
include_directories($OpenCV_INCLUDE_DIRS)
message(STATUS" include path:${OpenCV_INCLUDE_DIRS}")
target_link_libraries (Measure ${PCL_LIBRARIES}${OpenCV_LIBS})
2.cmake编译:
browse sourse,browse build,configure,generate
注意:configure中编译器选择vs2017,optional platform选择x64(默认win32)