CheckUncrustifyVersion.cmake 536 B

1234567891011121314
  1. if(UNCRUSTIFY_PRG)
  2. execute_process(COMMAND uncrustify --version
  3. OUTPUT_VARIABLE user_version
  4. OUTPUT_STRIP_TRAILING_WHITESPACE)
  5. string(REGEX REPLACE "[A-Za-z_#-]" "" user_version ${user_version})
  6. file(STRINGS ${CONFIG_FILE} required_version LIMIT_COUNT 1)
  7. string(REGEX REPLACE "[A-Za-z_# -]" "" required_version ${required_version})
  8. if(NOT user_version STREQUAL required_version)
  9. message(FATAL_ERROR "Wrong uncrustify version! Required version is ${required_version} but found ${user_version}")
  10. endif()
  11. endif()