mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
e12035fc0c
This to prevent the user from accidentally using the wrong uncrustify version.
14 lines
536 B
CMake
14 lines
536 B
CMake
if(UNCRUSTIFY_PRG)
|
|
execute_process(COMMAND uncrustify --version
|
|
OUTPUT_VARIABLE user_version
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
string(REGEX REPLACE "[A-Za-z_#-]" "" user_version ${user_version})
|
|
|
|
file(STRINGS ${CONFIG_FILE} required_version LIMIT_COUNT 1)
|
|
string(REGEX REPLACE "[A-Za-z_# -]" "" required_version ${required_version})
|
|
|
|
if(NOT user_version STREQUAL required_version)
|
|
message(FATAL_ERROR "Wrong uncrustify version! Required version is ${required_version} but found ${user_version}")
|
|
endif()
|
|
endif()
|