CppcheckTargets: fix for CMP0040

After cmake 3.0 you will have next warning:
CMake Warning (dev) at cmake/Modules/CppcheckTargets.cmake:197 (add_custom_command):
  Policy CMP0040 is not set: The target in the TARGET signature of
  add_custom_command() must exist.  Run "cmake --help-policy CMP0040" for
  policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  The target name "all_cppcheck" is unknown in this context.
Call Stack (most recent call first):
  CMakeLists.txt:69 (add_cppcheck)
  src/CMakeLists.txt:365 (CppCheck)
This warning is for project developers.  Use -Wno-dev to suppress it.

I guess that this is because of exporting targets into local functions, so I
add macro and call it from functions, thus add_custom_command() and
add_custom_target() called from the same scope.