forked from Kolyah35/minecraft-pe-0.6.1
EnumOption
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,8 +9,6 @@ CMakeFiles/
|
||||
CMakeCache.txt
|
||||
cmake_install.cmake
|
||||
Makefile
|
||||
*.cmake
|
||||
!cmake/CPM.cmake
|
||||
|
||||
# Compiled object files
|
||||
*.o
|
||||
|
||||
9
cmake/EnumOption.cmake
Normal file
9
cmake/EnumOption.cmake
Normal file
@@ -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()
|
||||
Reference in New Issue
Block a user