diff options
author | Ken Martin <ken.martin@kitware.com> | 2003-07-31 20:30:49 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2003-07-31 20:30:49 (GMT) |
commit | e9c517ecf1acb01eeb26024ab678620ca5b89387 (patch) | |
tree | d8b0263df919556223651ea4f4a221afd2d4a195 /Source/MFCDialog | |
parent | 42b39099a754ab62b59cea491866e0a6dca079b6 (diff) | |
download | CMake-e9c517ecf1acb01eeb26024ab678620ca5b89387.zip CMake-e9c517ecf1acb01eeb26024ab678620ca5b89387.tar.gz CMake-e9c517ecf1acb01eeb26024ab678620ca5b89387.tar.bz2 |
fix for spaces
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index 87afc06..1be0f86 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -122,6 +122,33 @@ void updateProgress(const char *msg, float prog, void *cd) } } +// Convert to Win32 path (slashes). This calls the system tools one and then +// removes the spaces. It is not in system tools because we don't want any +// generators accidentally use it +std::string ConvertToWindowsPath(const char* path) +{ + // Convert to output path. + // Remove the "" around it (if any) since it's an output path for + // the shell. If another shell-oriented feature is not designed + // for a GUI use, then we are in trouble. + + std::string s = cmSystemTools::ConvertToOutputPath(path); + if (s.size()) + { + std::string::iterator i = s.begin(); + if (*i == '\"') + { + s.erase(i, i + 1); + } + i = s.begin() + s.length() - 1; + if (*i == '\"') + { + s.erase(i, i + 1); + } + } + return s; +} + CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo, CWnd* pParent /*=NULL*/) : CDialog(CMakeSetupDialog::IDD, pParent) @@ -1402,7 +1429,7 @@ void CMakeSetupDialog::ChangeDirectoriesFromFile(const char* arg) // If there is a CMakeLists.txt file, use it as the source tree. if(listPath.length() > 0) { - std::string path = cmSystemTools::ConvertToOutputPath(listPath.c_str()); + std::string path = ConvertToWindowsPath(listPath.c_str()); m_WhereSource = path.c_str(); if(argIsFile) @@ -1417,7 +1444,7 @@ void CMakeSetupDialog::ChangeDirectoriesFromFile(const char* arg) // Source directory given on command line. Use current working // directory as build tree. std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - path = cmSystemTools::ConvertToOutputPath(cwd.c_str()); + path = ConvertToWindowsPath(cwd.c_str()); m_WhereBuild = path.c_str(); } } |