diff options
author | Jamie Snape <jamie.snape@kitware.com> | 2017-01-23 19:47:13 (GMT) |
---|---|---|
committer | Jamie Snape <jamie.snape@kitware.com> | 2017-01-23 19:47:13 (GMT) |
commit | 0618ddf6b1da3a886f12b6ad2b19da49b2f87e28 (patch) | |
tree | adb7c502f13bd571ff192e644de923f195b8fc81 /Tests/RunCMake/pseudo_cpplint.c | |
parent | 7b4514fb33cf256ef165b2b28ba4affd1930a957 (diff) | |
download | CMake-0618ddf6b1da3a886f12b6ad2b19da49b2f87e28.zip CMake-0618ddf6b1da3a886f12b6ad2b19da49b2f87e28.tar.gz CMake-0618ddf6b1da3a886f12b6ad2b19da49b2f87e28.tar.bz2 |
Add properties to run the cpplint style checker with the compiler
Create a `<LANG>_CPPLINT` target property (initialized by a
`CMAKE_<LANG>_CPPLINT` variable) to specify a `cpplint` style checker
command line to be run along with the compiler.
Diffstat (limited to 'Tests/RunCMake/pseudo_cpplint.c')
-rw-r--r-- | Tests/RunCMake/pseudo_cpplint.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/pseudo_cpplint.c b/Tests/RunCMake/pseudo_cpplint.c new file mode 100644 index 0000000..8b9ebf4 --- /dev/null +++ b/Tests/RunCMake/pseudo_cpplint.c @@ -0,0 +1,21 @@ +#include <stdio.h> +#include <string.h> + +int main(int argc, char* argv[]) +{ + int error = 0; + int i; + for (i = 1; i < argc; ++i) { + if (strcmp(argv[i], "--error") == 0) { + error = 1; + } + if (argv[i][0] != '-') { + if (error) { + fprintf(stderr, "%s:0: message [category/category] [0]\n", argv[i]); + } + fprintf(stdout, "Done processing %s\nTotal errors found: %i\n", argv[i], + error); + } + } + return error; +} |