cmake_minimum_required(VERSION 3.10)

project(robot_msg_cpp_example LANGUAGES CXX)

option(
  ROBOT_MSG_EXAMPLE_USE_INSTALLED
  "Use find_package(robot_msg) instead of the adjacent source tree"
  OFF
)

if(ROBOT_MSG_EXAMPLE_USE_INSTALLED)
  find_package(robot_msg CONFIG REQUIRED)
else()
  add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." robot_msg_build)
endif()

add_executable(robot_msg_cpp_example main.cpp)
target_link_libraries(robot_msg_cpp_example PRIVATE robot_msg::robot_msg)
