Shipwright/OTRGui/libs/raylib/cmake/EnumOption.cmake
M4xw f52a2a6406 git subrepo clone (merge) https://github.com/HarbourMasters/otrgui.git OTRGui
subrepo:
  subdir:   "OTRGui"
  merged:   "a6066a251"
upstream:
  origin:   "https://github.com/HarbourMasters/otrgui.git"
  branch:   "master"
  commit:   "a6066a251"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:53:51 +01:00

10 lines
396 B
CMake

macro(enum_option var values description)
set(${var}_VALUES ${values})
list(GET ${var}_VALUES 0 default)
set(${var} "${default}" CACHE STRING "${description}")
set_property(CACHE ${var} PROPERTY STRINGS ${${var}_VALUES})
if (NOT ";${${var}_VALUES};" MATCHES ";${${var}};")
message(FATAL_ERROR "Unknown value ${${var}}. Only -D${var}=${${var}_VALUES} allowed.")
endif()
endmacro()