Foxy CMakeLists.txt

From wikidb
Jump to: navigation, search
cmake_minimum_required(VERSION 3.5)
project(opencv_ros2sub)

if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(OpenCV REQUIRED)
find_package(cv_bridge REQUIRED)

include_directories(
  include
  ${OpenCV_INCLUDE_DIRS}
)

add_executable(opencv_exp src/opencv_exp.cpp)
ament_target_dependencies(
  opencv_exp
  cv_bridge
  rclcpp
  std_msgs
  sensor_msgs)

install(TARGETS
  opencv_exp
  DESTINATION lib/${PROJECT_NAME})

ament_package()