[cmake-commits] hoffman committed CMakeSetup.cxx 1.14 1.15 QCMake.cxx
1.14 1.15
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Feb 12 09:49:45 EST 2008
Update of /cvsroot/CMake/CMake/Source/QtDialog
In directory public:/mounts/ram/cvs-serv4780/Source/QtDialog
Modified Files:
CMakeSetup.cxx QCMake.cxx
Log Message:
ENH: fix make edit_cache for cmake-gui
Index: CMakeSetup.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeSetup.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- CMakeSetup.cxx 8 Feb 2008 15:42:14 -0000 1.14
+++ CMakeSetup.cxx 12 Feb 2008 14:49:42 -0000 1.15
@@ -26,6 +26,7 @@
#include "cmSystemTools.h"
#include "cmake.h"
#include "cmVersion.h"
+#include <cmsys/CommandLineArguments.hxx>
//----------------------------------------------------------------------------
static const char * cmDocumentationName[][3] =
@@ -125,20 +126,39 @@
dialog.setWindowTitle(title);
dialog.show();
- // for now: args support specifying build and/or source directory
- QStringList args = app.arguments();
- if(args.count() == 2)
+ cmsys::CommandLineArguments arg;
+ arg.Initialize(argc, argv);
+ std::string binaryDirectory;
+ std::string sourceDirectory;
+ typedef cmsys::CommandLineArguments argT;
+ arg.AddArgument("-B", argT::CONCAT_ARGUMENT,
+ &binaryDirectory, "Binary Directory");
+ arg.AddArgument("-H", argT::CONCAT_ARGUMENT,
+ &sourceDirectory, "Source Directory");
+ // do not complain about unknown options
+ arg.StoreUnusedArguments(true);
+ arg.Parse();
+ if(!sourceDirectory.empty() && !binaryDirectory.empty())
{
- QFileInfo buildFileInfo(args[1], "CMakeCache.txt");
- QFileInfo srcFileInfo(args[1], "CMakeLists.txt");
- if(buildFileInfo.exists())
- {
- dialog.setBinaryDirectory(buildFileInfo.absolutePath());
- }
- else if(srcFileInfo.exists())
+ dialog.setSourceDirectory(sourceDirectory.c_str());
+ dialog.setBinaryDirectory(binaryDirectory.c_str());
+ }
+ else
+ {
+ QStringList args = app.arguments();
+ if(args.count() == 2)
{
- dialog.setSourceDirectory(srcFileInfo.absolutePath());
- dialog.setBinaryDirectory(QDir::currentPath());
+ QFileInfo buildFileInfo(args[1], "CMakeCache.txt");
+ QFileInfo srcFileInfo(args[1], "CMakeLists.txt");
+ if(buildFileInfo.exists())
+ {
+ dialog.setBinaryDirectory(buildFileInfo.absolutePath());
+ }
+ else if(srcFileInfo.exists())
+ {
+ dialog.setSourceDirectory(srcFileInfo.absolutePath());
+ dialog.setBinaryDirectory(QDir::currentPath());
+ }
}
}
Index: QCMake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QCMake.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- QCMake.cxx 8 Feb 2008 16:26:08 -0000 1.14
+++ QCMake.cxx 12 Feb 2008 14:49:42 -0000 1.15
@@ -47,6 +47,7 @@
cmSystemTools::SetErrorCallback(QCMake::errorCallback, this);
this->CMakeInstance = new cmake;
+ this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
std::vector<std::string> generators;
More information about the Cmake-commits
mailing list