oranges_enable_clang_tidy

include (OrangesClangTidy)

View the full docs for this module.

oranges_enable_clang_tidy (<target>
                          [CONFIG_FILE <file>] | [NO_DEFAULT_CONFIG]
                          [EXTRA_ARGS <args...>]
                          [LANGS <C|CXX|OBJC|OBJCXX>...])

Configures clang-tidy for the given <target> by manipulating the target’s <LANG>_CLANG_TIDY properties.

If the CLANGTIDY_OFF variable is set to ON, this function does nothing.

Options:

CONFIG_FILE

May be specified to provide a custom .clang-tidy file to be used for running clang-tidy on this target. If a relative path is given, it will be evaluated relative to the value of CMAKE_CURRENT_LIST_DIR when this function is called. If this argument is not specified, the value of the CLANGTIDY_CONFIG_FILE variable will be used, unless the NO_DEFAULT_CONFIG option is given. Providing this argument is equivalent to passing EXTRA_ARGS --config-file=<file>.

NO_DEFAULT_CONFIG

If this option is given, then the value of the CLANGTIDY_CONFIG_FILE variable will not be used as this target’s .clang-tidy file; instead, clang-tidy’s default behavior of searching for a .clang-tidy in a parent directory of the current source file will be used.

EXTRA_ARGS

Extra arguments that will be passed verbatim to the clang-tidy executable. If not specified, the value of the CLANGTIDY_EXTRA_ARGS variable will be used.

LANGS

Languages for which to enable clang-tidy. Valid values are C, CXX, OBJC, or OBJCXX. If no languages are specified, this function will configure clang-tidy for all four valid languages.