diff options
author | Brad King <brad.king@kitware.com> | 2007-12-13 22:56:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-12-13 22:56:50 (GMT) |
commit | 9f61e2a235fc04e57237dc932aee61b264ef8916 (patch) | |
tree | 482f697639a0e55198f198eaf67282f088dee202 /Source/cmSystemTools.cxx | |
parent | ebc036bbdaa602c9276ad91469a305b42fda7cbc (diff) | |
download | CMake-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.cxx | 23 |
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(); +} |