Skip to content

Prevent cmakelint warnings #1138

Closed
@ClausKlein

Description

@ClausKlein

You may install https://pypi.org/project/cmakelint/

bash-5.0$ find . -name CMakeLists.txt | xargs cmakelint
./example/CMakeLists.txt:5: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:6: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:7: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:8: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:9: Weird indentation; use 2 spaces [whitespace/indent]
./example/CMakeLists.txt:14: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:15: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:15: Line ends in whitespace [whitespace/eol]
./example/CMakeLists.txt:16: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:17: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:18: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:19: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:20: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:23: Extra spaces between 'foreach' and its () [whitespace/extra]
./example/CMakeLists.txt:24: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:25: Tab found; please use spaces [whitespace/tabs]
./example/CMakeLists.txt:26: Tab found; please use spaces [whitespace/tabs]
./src/jsontestrunner/CMakeLists.txt:3: Extra spaces between 'find_package' and its () [whitespace/extra]
./src/jsontestrunner/CMakeLists.txt:13: Weird indentation; use 2 spaces [whitespace/indent]
./src/jsontestrunner/CMakeLists.txt:14: Weird indentation; use 2 spaces [whitespace/indent]
./src/jsontestrunner/CMakeLists.txt:42: Weird indentation; use 2 spaces [whitespace/indent]
./src/jsontestrunner/CMakeLists.txt:43: Weird indentation; use 2 spaces [whitespace/indent]
./src/jsontestrunner/CMakeLists.txt:46: Weird indentation; use 2 spaces [whitespace/indent]
./src/jsontestrunner/CMakeLists.txt:47: Weird indentation; use 2 spaces [whitespace/indent]
./src/lib_json/CMakeLists.txt:4: Weird indentation; use 2 spaces [whitespace/indent]
./src/lib_json/CMakeLists.txt:10: Expression repeated inside endif; better to use only endif() [readability/logic]
./src/lib_json/CMakeLists.txt:46: Mismatching spaces inside () after command [whitespace/mismatch]
./src/lib_json/CMakeLists.txt:69: Expression repeated inside else; better to use only else() [readability/logic]
./src/lib_json/CMakeLists.txt:84: Mismatching spaces inside () after command [whitespace/mismatch]
./src/lib_json/CMakeLists.txt:87: Mismatching spaces inside () after command [whitespace/mismatch]
./src/lib_json/CMakeLists.txt:144: Mismatching spaces inside () after command [whitespace/mismatch]
./src/lib_json/CMakeLists.txt:150: Mismatching spaces inside () after command [whitespace/mismatch]
./src/test_lib_json/CMakeLists.txt:3: Mismatching spaces inside () after command [whitespace/mismatch]
./src/test_lib_json/CMakeLists.txt:30: Mismatching spaces inside () after command [whitespace/mismatch]
./src/test_lib_json/CMakeLists.txt:34: Expression repeated inside else; better to use only else() [readability/logic]
./src/test_lib_json/CMakeLists.txt:36: Mismatching spaces inside () after command [whitespace/mismatch]
./src/test_lib_json/CMakeLists.txt:42: Weird indentation; use 2 spaces [whitespace/indent]
Total Errors: 37
bash-5.0$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions