cmake_minimum_required(VERSION 3.0)
project(pci-device
#  DESCRIPTION "PCI Device Example"
  LANGUAGES C)

# 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(PciDevice MODULE
  PciDevice.c
)
target_link_libraries(PciDevice PRIVATE temu::support)

install(TARGETS PciDevice
  DESTINATION share/temu/examples/pci-device/)
install(FILES CMakeLists.txt PciDevice.c README.adoc
  DESTINATION share/temu/examples/pci-device/)
