I am new to Computer Vision. On Cmake, i am trying to use PCL and OpenCV with a 2D Lidar sensor.
I saw this tutorial: [http://unanancyowen.com/en/pcl18/#Download1
And to configure PCL on CmakeLists.txt the following code is used:
cmake_minimum_required( VERSION 2.8 )
# Create Project
project( solution )
add_executable( project main.cpp )
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
# Find Packages
find_package( PCL 1.8 REQUIRED )
if( PCL_FOUND )
# Additional Include Directories
# [C/C++]>[General]>[Additional Include Directories]
include_directories( ${PCL_INCLUDE_DIRS} )
# Preprocessor Definitions
# [C/C++]>[Preprocessor]>[Preprocessor Definitions]
add_definitions( ${PCL_DEFINITIONS} )
#add_definitions( -DPCL_NO_PRECOMPILE )
# Additional Library Directories
# [Linker]>[General]>[Additional Library Directories]
link_directories( ${PCL_LIBRARY_DIRS} )
# Additional Dependencies
# [Linker]>[Input]>[Additional Dependencies]
target_link_libraries( project ${PCL_LIBRARIES} )
endif()
And to configure CmakeLists.txt for OpenCV, the following code:
cmake_minimum_required( VERSION 3.6 )
# Create Project
project( solution )
add_executable( project main.cpp )
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
# Find OpenCV
set( OpenCV_DIR "C:/Program Files/opencv/build" )
find_package( OpenCV REQUIRED )
# Project Settings for OpenCV
if( OpenCV_FOUND )
# Additional Include Directories
# [C/C++]>[General]>[Additional Include Directories]
include_directories( ${OpenCV_INCLUDE_DIRS} )
# Additional Library Directories
# [Linker]>[General]>[Additional Library Directories]
link_directories( ${OpenCV_LIB_DIR} )
# Additional Dependencies
# [Linker]>[Input]>[Additional Dependencies]
target_link_libraries( project ${OpenCV_LIBS} )
endif()
How do i make a CmakeLists.txt to use with both? PCL and OpenCV.