diff options
Diffstat (limited to 'libs/raylib/cmake/EnumOption.cmake')
-rw-r--r-- | libs/raylib/cmake/EnumOption.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/raylib/cmake/EnumOption.cmake b/libs/raylib/cmake/EnumOption.cmake new file mode 100644 index 0000000..d7d343f --- /dev/null +++ b/libs/raylib/cmake/EnumOption.cmake @@ -0,0 +1,9 @@ +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() |