diff options
author | Brad King <brad.king@kitware.com> | 2016-05-03 14:17:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-05-03 14:17:00 (GMT) |
commit | 3fc49c50b0a62ab66376b624d1d38e30ffbbc4dd (patch) | |
tree | 38458f0b83645ab8d64470925a9ec5a08ad8a9b7 /Source | |
parent | c212b5b02517559dcda611cc7a59519542e1ce6d (diff) | |
parent | 5f948d2aa41cc83da989ea058a4e5f008edd12f6 (diff) | |
download | CMake-3fc49c50b0a62ab66376b624d1d38e30ffbbc4dd.zip CMake-3fc49c50b0a62ab66376b624d1d38e30ffbbc4dd.tar.gz CMake-3fc49c50b0a62ab66376b624d1d38e30ffbbc4dd.tar.bz2 |
Merge topic 'doc-cmake-policies-manual-improvements'
5f948d2a Help: Add policy summaries to cmake-policies(7)
b74d73e5 Help: Organize cmake-policies(7) manual by version of introduction
de370656 cmRST: Parse toctree lines with Sphinx cross-reference syntax
845cb217 CMP0059: Fix typo in policy description
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmPolicies.h | 2 | ||||
-rw-r--r-- | Source/cmRST.cxx | 16 | ||||
-rw-r--r-- | Source/cmRST.h | 1 |
3 files changed, 15 insertions, 4 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 5023055..dbea895 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -204,7 +204,7 @@ class cmPolicy; "Ninja requires custom command byproducts to be explicit.", \ 3, 3, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0059, \ - "Do no treat DEFINITIONS as a built-in directory property.", \ + "Do not treat DEFINITIONS as a built-in directory property.", \ 3, 3, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0060, \ "Link libraries by full path even in implicit directories.", \ diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 67667ea..44d4289 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -46,7 +46,8 @@ cmRST::cmRST(std::ostream& os, std::string const& docroot): "):`(<*([^`<]|[^` \t]<)*)([ \t]+<[^`]*>)?`"), Substitution("(^|[^A-Za-z0-9_])" "((\\|[^| \t\r\n]([^|\r\n]*[^| \t\r\n])?\\|)(__|_|))" - "([^A-Za-z0-9_]|$)") + "([^A-Za-z0-9_]|$)"), + TocTreeLink("^.*[ \t]+<([^>]+)>$") { this->Replace["|release|"] = cmVersion::GetCMakeVersion(); } @@ -429,9 +430,18 @@ void cmRST::ProcessDirectiveTocTree() for(std::vector<std::string>::iterator i = this->MarkupLines.begin(); i != this->MarkupLines.end(); ++i) { - if(!i->empty() && i->find_first_of(":") == i->npos) + std::string const& line = *i; + if (!line.empty() && line[0] != ':') { - this->ProcessInclude(*i + ".rst", IncludeTocTree); + if (this->TocTreeLink.find(line)) + { + std::string const& link = this->TocTreeLink.match(1); + this->ProcessInclude(link + ".rst", IncludeTocTree); + } + else + { + this->ProcessInclude(line + ".rst", IncludeTocTree); + } } } } diff --git a/Source/cmRST.h b/Source/cmRST.h index b9b2366..098afab 100644 --- a/Source/cmRST.h +++ b/Source/cmRST.h @@ -89,6 +89,7 @@ private: cmsys::RegularExpression ModuleRST; cmsys::RegularExpression CMakeRole; cmsys::RegularExpression Substitution; + cmsys::RegularExpression TocTreeLink; std::vector<std::string> MarkupLines; std::string DocDir; |