CMake commands are valid in lower, upper, and mixed case. Mixing all of those together in one file however reduces the readability of the CMake code.
Is there a tool for automatically correcting this kind of stylistic inconsistencies?
CMake commands are valid in lower, upper, and mixed case. Mixing all of those together in one file however reduces the readability of the CMake code.
Is there a tool for automatically correcting this kind of stylistic inconsistencies?
The answer by steveire links to the right resources, but let me explain explicitly in case those links vanish.
CMake command are case insensitive but lower case is recommended according to CMake developer Brad King in 2012:
The shell code that allowed to convert my project
CMakeLists.txt
file to lower case was inspired by the code behind the links of steveire's answer:It has the following improvements:
grep -v "cmake version"
is not required anymore because it seems that the--help-command-list
output does not contain that anymore\b
which made it not match any thing with GNU sed 4.2.2Find_Package
.Adapt this to your needs:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77543bd
See also:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9db31162