summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-09-30 13:47:17 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-30 20:17:31 (GMT)
commit0fe2ee3d4393177a4850a3da3e9b0df89239f294 (patch)
tree21c4d5255319c70c1572dd36a264564158f118b6 /Source/cmSystemTools.cxx
parent391ff1ec518bea4bbaac95b6a3737b82c65656d3 (diff)
downloadCMake-0fe2ee3d4393177a4850a3da3e9b0df89239f294.zip
CMake-0fe2ee3d4393177a4850a3da3e9b0df89239f294.tar.gz
CMake-0fe2ee3d4393177a4850a3da3e9b0df89239f294.tar.bz2
CMake GUI: Add "CMake Reference Manual" help item
And switch the ordering of "Help" and "About".
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 7d2dd54..97440d2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2077,6 +2077,7 @@ static std::string cmSystemToolsCMakeCursesCommand;
static std::string cmSystemToolsCMakeGUICommand;
static std::string cmSystemToolsCMClDepsCommand;
static std::string cmSystemToolsCMakeRoot;
+static std::string cmSystemToolsHTMLDoc;
void cmSystemTools::FindCMakeResources(const char* argv0)
{
std::string exe_dir;
@@ -2166,10 +2167,15 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
// Install tree has
// - "<prefix><CMAKE_BIN_DIR>/cmake"
// - "<prefix><CMAKE_DATA_DIR>"
+ // - "<prefix><CMAKE_DOC_DIR>"
if (cmHasLiteralSuffix(exe_dir, CMAKE_BIN_DIR)) {
std::string const prefix =
exe_dir.substr(0, exe_dir.size() - cmStrLen(CMAKE_BIN_DIR));
cmSystemToolsCMakeRoot = cmStrCat(prefix, CMAKE_DATA_DIR);
+ if (cmSystemTools::FileExists(
+ cmStrCat(prefix, CMAKE_DOC_DIR "/html/index.html"))) {
+ cmSystemToolsHTMLDoc = cmStrCat(prefix, CMAKE_DOC_DIR "/html");
+ }
}
if (cmSystemToolsCMakeRoot.empty() ||
!cmSystemTools::FileExists(
@@ -2192,6 +2198,11 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
cmSystemToolsCMakeRoot = src_dir;
}
}
+ if (!cmSystemToolsCMakeRoot.empty() && cmSystemToolsHTMLDoc.empty() &&
+ cmSystemTools::FileExists(
+ cmStrCat(dir, "/Utilities/Sphinx/html/index.html"))) {
+ cmSystemToolsHTMLDoc = cmStrCat(dir, "/Utilities/Sphinx/html");
+ }
}
#else
// Bootstrap build knows its source.
@@ -2234,6 +2245,11 @@ std::string const& cmSystemTools::GetCMakeRoot()
return cmSystemToolsCMakeRoot;
}
+std::string const& cmSystemTools::GetHTMLDoc()
+{
+ return cmSystemToolsHTMLDoc;
+}
+
std::string cmSystemTools::GetCurrentWorkingDirectory()
{
return cmSystemTools::CollapseFullPath(