25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
396 B

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