diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2010-05-05 12:48:30 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2010-05-05 12:49:24 (GMT) |
commit | 1df3f58317120567697cf5ae7b628c4674625b4a (patch) | |
tree | 6c1a7414621f634f1f822d45e1bf4ebf9583935b /Source/QtDialog/CMakeSetup.cxx | |
parent | 0bf998a46bb52cb9006ee73e9b7166f0abb69170 (diff) | |
download | CMake-1df3f58317120567697cf5ae7b628c4674625b4a.zip CMake-1df3f58317120567697cf5ae7b628c4674625b4a.tar.gz CMake-1df3f58317120567697cf5ae7b628c4674625b4a.tar.bz2 |
BUG: Fix Bug #9975 when softlinks are used.
Diffstat (limited to 'Source/QtDialog/CMakeSetup.cxx')
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index e613a78..fc61709 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "QCMake.h" // include to disable MS warnings #include <QApplication> -#include <QFileInfo> #include <QDir> #include <QTranslator> #include <QLocale> @@ -21,6 +20,7 @@ #include "cmake.h" #include "cmVersion.h" #include <cmsys/CommandLineArguments.hxx> +#include <cmsys/SystemTools.hxx> //---------------------------------------------------------------------------- static const char * cmDocumentationName[][3] = @@ -164,16 +164,19 @@ int main(int argc, char** argv) QStringList args = app.arguments(); if(args.count() == 2) { - QFileInfo buildFileInfo(args[1], "CMakeCache.txt"); - QFileInfo srcFileInfo(args[1], "CMakeLists.txt"); - if(buildFileInfo.exists()) + cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(".."); + cmsys_stl::string buildFilePath = + cmSystemTools::CollapseFullPath("CMakeCache.txt", filePath.c_str()); + cmsys_stl::string srcFilePath = + cmSystemTools::CollapseFullPath("CMakeLists.txt", filePath.c_str()); + if(cmSystemTools::FileExists(buildFilePath.c_str())) { - dialog.setBinaryDirectory(buildFileInfo.absolutePath()); + dialog.setBinaryDirectory(filePath.c_str()); } - else if(srcFileInfo.exists()) + else if(cmSystemTools::FileExists(srcFilePath.c_str())) { - dialog.setSourceDirectory(srcFileInfo.absolutePath()); - dialog.setBinaryDirectory(QDir::currentPath()); + dialog.setSourceDirectory(filePath.c_str()); + dialog.setBinaryDirectory(cmSystemTools::CollapseFullPath(".").c_str()); } } } |