summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 52031ea..52e1ca2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2064,3 +2064,26 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile)
#endif
return true;
}
+
+//----------------------------------------------------------------------------
+static std::string cmSystemToolsExecutableDirectory;
+void cmSystemTools::FindExecutableDirectory(const char* argv0)
+{
+ std::string errorMsg;
+ std::string exe;
+ if(cmSystemTools::FindProgramPath(argv0, exe, errorMsg))
+ {
+ cmSystemToolsExecutableDirectory =
+ cmSystemTools::GetFilenamePath(exe.c_str());
+ }
+ else
+ {
+ // ???
+ }
+}
+
+//----------------------------------------------------------------------------
+const char* cmSystemTools::GetExecutableDirectory()
+{
+ return cmSystemToolsExecutableDirectory.c_str();
+}