cmake_minimum_required(VERSION 3.0)
project(can-bus-example
#  DESCRIPTION "CAN Bus Implementation Example"
  LANGUAGES CXX)

# Avoid looking for TEMU library if part of TEMU build itself
# For end users, set CMAKE_PREFIX_PATH to the install location of temu
#   or set TEMU_DIR to the directory of the TEMUConfig.cmake file or
#   on newer CMake (3.15 +) set TEMU_ROOT to the install location of temu.
if (NOT TARGET temu::support)
  find_package(TEMU REQUIRED CONFIG)
endif()

add_library(CANBus MODULE
  CANBus.cpp
)
target_link_libraries(CANBus PRIVATE temu::support)

install(TARGETS CANBus
  DESTINATION share/temu/examples/can-bus/)
install(FILES CMakeLists.txt CANBus.cpp README.md Makefile
  DESTINATION share/temu/examples/can-bus/)
