Added ability to use cppcheck from the command line.
CMake now detects cppcheck, and enables "make cppcheck" to run
cppcheck on all source files, generated kernels and some other files
excluded. Commands are more or less the same as used in Jenkins.
A separate target is produced for each input file, allowing one to use
build system parallelism (tested that it doesn't have much effect on the
overall run time). This also adds a nice property that after the
initial run, cppcheck gets only run on modified files. All errors
(including those from unmodified files) are also collected into a single
text file for easier processing.
No effort has been made to make it particularly robust or portable,
e.g., with respect to different cppcheck versions, as it is mostly for
developer convenience to be able to reproduce the runs from Jenkins.
Ideally, Jenkins would also run cppcheck using the generated rules,
which would allow changing the cppcheck configuration in sync with
source code changes if that is necessary. For this purpose, a CMake
option to switch to XML output files is provided.
Change-Id: Ib88e2ba87cd4f091484fe09beac5ef108b0fad77