Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1e440c5530260ba8d8f2b8e4441ec28e47be9cdc Mon Sep 17 00:00:00 2001
- From: fish <physhh@gmail.com>
- Date: Fri, 1 Nov 2013 23:30:23 +0100
- Subject: [PATCH] CMake-GUI command line arguments get now forwarded to CMake
- in the same way as it is already implemented in CCMake
- ---
- Source/QtDialog/QCMake.cxx | 9 +++++++++
- Source/QtDialog/QCMake.h | 3 +++
- 2 files changed, 12 insertions(+)
- diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
- index 0d01181..3f279f3 100644
- --- a/Source/QtDialog/QCMake.cxx
- +++ b/Source/QtDialog/QCMake.cxx
- @@ -12,6 +12,7 @@
- #include "QCMake.h"
- +#include <QApplication>
- #include <QDir>
- #include <QCoreApplication>
- @@ -45,6 +46,12 @@ QCMake::QCMake(QObject* p)
- execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
- }
- #endif
- +
- + // Load application arguments
- + QStringList qtArgs = QApplication::instance()->arguments();
- + for(QList<QString>::iterator it = qtArgs.begin(); it != qtArgs.end(); ++it) {
- + Args.push_back(it->toStdString());
- + }
- QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
- cmakeCommand = execDir.filePath(cmakeCommand);
- @@ -62,6 +69,7 @@ QCMake::QCMake(QObject* p)
- this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
- #endif
- this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
- + this->CMakeInstance->SetArgs(this->Args);
- cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);
- @@ -170,6 +178,7 @@ void QCMake::configure()
- this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings);
- this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode);
- this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode);
- + this->CMakeInstance->SetCacheArgs(this->Args);
- this->CMakeInstance->PreLoadCMakeFiles();
- InterruptFlag = 0;
- diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
- index 93ac8ab..4f68eaf 100644
- --- a/Source/QtDialog/QCMake.h
- +++ b/Source/QtDialog/QCMake.h
- @@ -24,6 +24,8 @@
- #include <QStringList>
- #include <QMetaType>
- #include <QAtomicInt>
- +#include <vector>
- +#include <string>
- class cmake;
- @@ -133,6 +135,7 @@ signals:
- protected:
- cmake* CMakeInstance;
- + std::vector<std::string> Args;
- static bool interruptCallback(void*);
- static void progressCallback(const char* msg, float percent, void* cd);
- --
- 1.8.3.msysgit.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement