aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/cmake/CheckStringOptionValue.cmake
blob: bc4d7b5749b01ec14d331e982a1f67c1431eec5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function(check_string_option_value option)
  get_property(expected_values CACHE ${option} PROPERTY STRINGS)
  if(expected_values)
    foreach(value IN LISTS expected_values)
      if(value STREQUAL "${${option}}")
        return()
      endif()
    endforeach()
    message(FATAL_ERROR "${option} value is \"${${option}}\", but must be one of ${expected_values}.")
  endif()
  message(AUTHOR_WARNING "The STRINGS property must be set before invoking `check_string_option_value' function.")
endfunction()