summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-12-13 22:56:50 (GMT)
committerBrad King <brad.king@kitware.com>2007-12-13 22:56:50 (GMT)
commit9f61e2a235fc04e57237dc932aee61b264ef8916 (patch)
tree482f697639a0e55198f198eaf67282f088dee202 /Source/cmSystemTools.cxx
parentebc036bbdaa602c9276ad91469a305b42fda7cbc (diff)
downloadCMake-9f61e2a235fc04e57237dc932aee61b264ef8916.zip
CMake-9f61e2a235fc04e57237dc932aee61b264ef8916.tar.gz
CMake-9f61e2a235fc04e57237dc932aee61b264ef8916.tar.bz2
ENH: Centralized and globalized computation of CMake program locations. This eliminates startup paths that failed to produce this information.
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();
+}