polysquare/clang-tidy-target-cmake — pull request #2 by smspillaz (2014-09-27 09:15:27+00:00)
Title: Added support for disabled checks and custom targets.

Since custom targets don't have their sources added to a compilation
database, we need to do the heavy lifting there ourselves. Generate
a "compilation database" for each source file added in the directory
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_compile_commands and point
clang-tidy to that.

This means that we need to create the "compilation database" with
reasonable accuracy - the language of each file must be detected
as far as possible and the appropriate defines, includes and
compiler flags be passed.