diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-10-26 21:15:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-27 13:15:00 (GMT) |
commit | 054754359a0b6b5721dea722b7920c954a573451 (patch) | |
tree | 5d413615e6c66f8d72460df4f7d50a11926a4ce5 /Source/cmRST.cxx | |
parent | fb6ab54076217452e673ad310faba2a1a993366f (diff) | |
download | CMake-054754359a0b6b5721dea722b7920c954a573451.zip CMake-054754359a0b6b5721dea722b7920c954a573451.tar.gz CMake-054754359a0b6b5721dea722b7920c954a573451.tar.bz2 |
cmRST: support `versionadded` and `versionchanged` directives
This makes `versionadded` and `versionchanged` directives show up in
`cmake --help-*` output instead of disappearing (and potentially making
empty sections).
Fixes: #22808
Diffstat (limited to 'Source/cmRST.cxx')
-rw-r--r-- | Source/cmRST.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index fce6e80..1e4dedd 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -35,6 +35,7 @@ cmRST::cmRST(std::ostream& os, std::string docroot) , TocTreeDirective("^.. toctree::[ \t]*(.*)$") , ProductionListDirective("^.. productionlist::[ \t]*(.*)$") , NoteDirective("^.. note::[ \t]*(.*)$") + , VersionDirective("^.. version(added|changed)::[ \t]*(.*)$") , ModuleRST(R"(^#\[(=*)\[\.rst:$)") , CMakeRole("(:cmake)?:(" "command|cpack_gen|generator|genex|" @@ -209,6 +210,10 @@ void cmRST::ProcessLine(std::string const& line) } else if (this->NoteDirective.find(line)) { // Output note directives and their content normally. this->NormalLine(line); + } else if (this->VersionDirective.find(line)) { + // Output versionadded and versionchanged directives and their content + // normally. + this->NormalLine(line); } } // An explicit markup start followed nothing but whitespace and a |