FIND_PACKAGE(PCL 1.7 REQUIRED)
FIND_PACKAGE(OpenCV 3.0.0 REQUIRED COMPONENTS core highgui calib3d)
INCLUDE_DIRECTORIES(
${PCL_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${OpenCV_INCLUDE_DIRS}
)
MESSAGE(${PCL_INCLUDE_DIRS})
MESSAGE(${OpenCV_INCLUDE_DIRS})
MESSAGE(${PCL_LIBRARY_DIRS})
LINK_DIRECTORIES(${PCL_LIBRARY_DIRS} )
LINK_DIRECTORIES(/usr/local/lib )
ADD_DEFINITIONS(${PCL_DEFINITIONS} )
SET(DAM_PROTO ProtoDam)
EXEC_PROGRAM(protoc ${CMAKE_CURRENT_SOURCE_DIR} ARGS "--cpp_out=${CMAKE_CURRENT_BINARY_DIR}" ${DAM_PROTO}.proto)
MESSAGE(${OpenCV_INCLUDE_DIRS})
ADD_EXECUTABLE(BuildDam BuildDam.cpp ${DAM_PROTO}.pb.cc)
TARGET_LINK_LIBRARIES (BuildDam ${PCL_LIBRARIES} protobu ${OpenCV_LIBS} )
CMakelists.txt:
MESSAGE(${PCL_INCLUDE_DIRS})
MESSAGE(${OpenCV_INCLUDE_DIRS})
MESSAGE(${PCL_LIBRARY_DIRS})
/usr/local/include/pcl-1.7/usr/include/eigen3/usr/include/usr/include/vtk-5.8
/usr/local/include/opencv/usr/local/include
/usr/local/lib
running cd "/home/nest/work_new/BuildDam/src" && protoc --cpp_out=/home/nest/work_new/BuildDam/build/src ProtoDam.proto 2>&1
/usr/local/include/opencv/usr/local/include
变量对应关系:
PCL_INCLUDE_DIRS : /usr/local/include/pcl-1.7/usr/include/eigen3/usr/include/usr/include/vtk-5.8
OpenCV_INCLUDE_DIRS: /usr/local/include/opencv/usr/local/include
PCL_LIBRARY_DIRS : /usr/local/lib