
set(SlotCar_HEADERS
  aiff.h
  BasicCar.h
  Car.h
  Curve.h
  InventorLogo.h
  windows/getopt.h
  LODD.h
  Network.h
  Packet.h
  windows/print.h
  RaceCar.h
  windows/resource.h
  RobotCar.h
  sample.h
  Sky.h
  StartFinish.h
  State.h
  Straight.h
  Track.h
)

set(SlotCar_RESOURCES
  windows/Slotcar.rc
)

set(SlotCar_SOURCES
  Car.cxx
  Curve.cxx
  windows/drand48.c
  windows/getopt.c
  LODD.cxx
  MouseInput.cxx
  Network.cxx
  Packet.cxx
  RaceCar.cxx
  RobotCar.cxx
  Simulation.cxx
  Sky.cxx
  slotcar.cxx
  StartFinish.cxx
  State.cxx
  Straight.cxx
  Track.cxx
)

if(WIN32)
  list(APPEND SlotCar_SOURCES
      windows/OptionDlg.cxx
      windows/print.c
  )
endif()

source_group("Resource Files" FILES ${SlotCar_RESOURCES})
source_group("Header Files" FILES ${SlotCar_HEADERS})

add_oiv_executable(SlotCar ${SlotCar_SOURCES} ${SlotCar_HEADERS} ${SlotCar_RESOURCES})

if(WIN32)
  target_link_libraries(SlotCar winmm.lib)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
  target_link_libraries(SlotCar tirpc)
endif()