|
|
@@ -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(
|