I have a project that uses CMake with a top level CMakeLists which references subdirectories each with their own targets and CMakeLists. Each subdirectory includes src
, include
dirs.
I'm trying to execute Cppcheck on my code base using the following command:
cppcheck --project=compile_commands.json --suppressions-list=suppressions.txt --output-file=cppcheck-results.log --xml --enable=all
My suppressions.txt file contains a bunch of style errors to skip.
The problem is that it doesn't catch any error/issue in local .h files (inside the include directories).
Unless I specify cppcheck to check a specific directory and give the -I flag, then it would. But for the whole project it does not.