mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-07 04:02:23 +03:00
Help: Allow command-line help of per-language and per-config variables
Extend commit 4e50320978 (Help: Allow help for arbitrary keywords,
2023-08-31, v3.28.0-rc1~31^2).
This commit is contained in:
1 parent
24d023247a
commit
bd059a9c54
3 files changed
+19
No files matched your search
@@ -747,6 +747,11 @@ bool cmDocumentation::PrintHelpOneVariable(std::ostream& os)
|
||||
if (this->PrintFiles(os, cmStrCat("variable/", vname))) {
|
||||
return true;
|
||||
}
|
||||
std::string const generalized = GeneralizeKeyword(vname);
|
||||
if (generalized != vname &&
|
||||
this->PrintFiles(os, cmStrCat("variable/", generalized))) {
|
||||
return true;
|
||||
}
|
||||
// Argument was not a variable. Complain.
|
||||
os << "Argument \"" << this->CurrentArgument
|
||||
<< "\" to --help-variable is not a defined variable. "
|
||||
|
||||
@@ -1266,6 +1266,7 @@ run_cmake(ProfilingTest)
|
||||
unset(RunCMake_TEST_OPTIONS)
|
||||
|
||||
run_cmake_with_options(help-arbitrary "--help" "CMAKE_CXX_IGNORE_EXTENSIONS")
|
||||
run_cmake_with_options(help-variable-lang "--help-variable" "CMAKE_CXX_PVS_STUDIO")
|
||||
|
||||
if (WIN32 OR DEFINED ENV{HOME})
|
||||
set(config_dir_test print-config-dir)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
CMAKE_<LANG>_PVS_STUDIO
|
||||
-----------------------
|
||||
|
||||
.. versionadded:: 4.3
|
||||
|
||||
Default value for ``<LANG>_PVS_STUDIO`` target property
|
||||
when ``<LANG>`` is ``C`` or ``CXX``.
|
||||
|
||||
This variable is used to initialize the property on each target as it is
|
||||
created. For example:
|
||||
|
||||
set\(CMAKE_CXX_PVS_STUDIO pvs-studio-analyzer analyze -a "GA\\;OP"\)
|
||||
add_executable\(foo foo\.cxx\)
|
||||
Reference in new issue
Block a user