This document describes all the available checks and their configuration.
id: C001
Check C001 can be used to verify that certain CMake commands exist or not exist. This check can be used to:
-
forbid specific CMake vocabulary
-
force the existence of certain commands (e.g.
target_link_librariesfor target CMakeLists)
Example:
"config": {
"commands": [
{
"name": "^add_library|add_executable$",
"occurences": "1"
},
{
"name": "^target_link_libraries$",
"occurences": "1+"
},
{
"name": "^target_include_directories$",
"occurences": "1"
}
]
}required, type: string
A regular expression that defines the affected command(s).
-
targetmatches any command with target in its name -
^target_include_directories$matches exactly thetarget_include_directoriescommand -
^command1|command2$matches exactlycommand1orcommand2
id: C003
Check C003 should be used to list all allowed CMake commands. Its primary use is to control user defined commands. A warning is generated for each command that is not in the list.
To explicitly forbid commands use check C001.