cmake_minimum_required(VERSION 3.0.2)
project(test)
FIND_PACKAGE(OpenCV 4.5.5)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
          OpenCV
  roscpp
  cv_bridge
      image_transport
      std_msgs

)

catkin_package()

#some qt5-camke setting
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

#load Qt5 include and lib path variables
find_package(Qt5 COMPONENTS Widgets REQUIRED)

#load PCL and VTK include and lib path variables
find_package(PCL REQUIRED)
find_package(VTK REQUIRED)

#note: <pcl> has included the <vtk>, so we just need to set the <pcl>'s include and lib path for project
include_directories(${PCL_INCLUDE_DIRS}) #set the .h search path for <pcl> and <vtk>
link_directories(${PCL_LIBRARY_DIRS}) #set the lib search path for <pcl> and <vtk>
add_definitions(${PCL_DEFINITIONS})

add_executable(test1
    src/mainwindow.ui
    src/mainwindow.cpp
    src/main.cpp
)

target_link_libraries(test1 Qt5::Widgets ${VTK_LIBRARIES} ${OpenCV_LIBS} ${PCL_LIBRARIES})
