diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-05-23 20:28:34 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-05-23 20:28:34 (GMT) |
commit | 768134c690a2d9a6cf2669e2a46189936fcae2aa (patch) | |
tree | 8ffddb156bd1d131a5ce30b766a79509b49840b3 | |
parent | 1a2a3abbfd4d98fa541ab67635bc72ff125773b3 (diff) | |
download | CMake-768134c690a2d9a6cf2669e2a46189936fcae2aa.zip CMake-768134c690a2d9a6cf2669e2a46189936fcae2aa.tar.gz CMake-768134c690a2d9a6cf2669e2a46189936fcae2aa.tar.bz2 |
command line fixes for win32
-rw-r--r-- | Source/cmSystemTools.cxx | 10 | ||||
-rw-r--r-- | Source/cmake.cxx | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c944515..7f9bb12 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -734,7 +734,13 @@ std::string cmSystemTools::FindProgram(const char* name, { return cmSystemTools::CollapseFullPath(name); } - + std::string tryPath = name; + tryPath += cmSystemTools::GetExecutableExtension(); + if(cmSystemTools::FileExists(tryPath.c_str())) + { + return cmSystemTools::CollapseFullPath(tryPath.c_str()); + } + // Add the system search path to our path. std::vector<std::string> path = userPaths; cmSystemTools::GetPath(path); @@ -742,7 +748,7 @@ std::string cmSystemTools::FindProgram(const char* name, for(std::vector<std::string>::const_iterator p = path.begin(); p != path.end(); ++p) { - std::string tryPath = *p; + tryPath = *p; tryPath += "/"; tryPath += name; if(cmSystemTools::FileExists(tryPath.c_str())) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5655274..00bbfdb 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -84,12 +84,10 @@ void cmake::SetArgs(cmMakefile& builder, int ac, char** av) (cmSystemTools::GetCurrentWorkingDirectory().c_str()); if (ac == 2) { - std::string hdir = cmSystemTools::GetCurrentWorkingDirectory() - + "/" + av[1]; builder.SetHomeDirectory - (cmSystemTools::CollapseFullPath(hdir.c_str()).c_str()); + (cmSystemTools::CollapseFullPath(av[1]).c_str()); builder.SetStartDirectory - (cmSystemTools::CollapseFullPath(hdir.c_str()).c_str()); + (cmSystemTools::CollapseFullPath(av[1]).c_str()); } else { @@ -146,7 +144,9 @@ void cmake::SetArgs(cmMakefile& builder, int ac, char** av) void cmake::AddCMakePaths(char **av) { // Find our own exectuable. - std::string cMakeSelf = cmSystemTools::FindProgram(av[0]); + std::string cMakeSelf = av[0]; + cmSystemTools::ConvertToUnixSlashes(cMakeSelf); + cMakeSelf = cmSystemTools::FindProgram(cMakeSelf.c_str()); // Save the value in the cache cmCacheManager::GetInstance()->AddCacheEntry |