cmake_minimum_required(VERSION 3.0)
project(simple-simulator
#  DESCRIPTION "Simple Simulator 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_executable(simple-simulator 
  SimpleSimulator.c
)
set_target_properties(simple-simulator
  PROPERTIES
    C_STANDARD 99
    C_STANDARD_REQUIRED yes
)
target_link_libraries(simple-simulator PRIVATE temu::support)


add_executable(simple-simulator2 
  SimpleSimulator2.c
)
set_target_properties(simple-simulator2
  PROPERTIES
    C_STANDARD 99
    C_STANDARD_REQUIRED yes
)
target_link_libraries(simple-simulator2 PRIVATE temu::support)



install(TARGETS simple-simulator simple-simulator2
  DESTINATION share/temu/examples/simple-simulator/)
install(FILES CMakeLists.txt SimpleSimulator.c SimpleSimulator2.c obsw.c obsw.elf README.md Makefile
  DESTINATION share/temu/examples/simple-simulator/)
