Added dependency on cppcheck-target-cmake and add all source files.

This allows all source files to be analyzed by the static analyzer
after building each target.

External headers are not analyzed due to their complexity and thus
exponential contribution to the build time.

Fixed some style issues noted by the checker, namely a
variable initialization that did not occurr in a constructor
initializer list and an unused variable which could not be
elided by the compiler.