Advertisement
Guest User

Untitled

a guest
Nov 1st, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. From 1e440c5530260ba8d8f2b8e4441ec28e47be9cdc Mon Sep 17 00:00:00 2001
  2. From: fish <physhh@gmail.com>
  3. Date: Fri, 1 Nov 2013 23:30:23 +0100
  4. Subject: [PATCH] CMake-GUI command line arguments get now forwarded to CMake
  5. in the same way as it is already implemented in CCMake
  6.  
  7. ---
  8. Source/QtDialog/QCMake.cxx | 9 +++++++++
  9. Source/QtDialog/QCMake.h | 3 +++
  10. 2 files changed, 12 insertions(+)
  11.  
  12. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
  13. index 0d01181..3f279f3 100644
  14. --- a/Source/QtDialog/QCMake.cxx
  15. +++ b/Source/QtDialog/QCMake.cxx
  16. @@ -12,6 +12,7 @@
  17.  
  18. #include "QCMake.h"
  19.  
  20. +#include <QApplication>
  21. #include <QDir>
  22. #include <QCoreApplication>
  23.  
  24. @@ -45,6 +46,12 @@ QCMake::QCMake(QObject* p)
  25. execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
  26. }
  27. #endif
  28. +
  29. + // Load application arguments
  30. + QStringList qtArgs = QApplication::instance()->arguments();
  31. + for(QList<QString>::iterator it = qtArgs.begin(); it != qtArgs.end(); ++it) {
  32. + Args.push_back(it->toStdString());
  33. + }
  34.  
  35. QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
  36. cmakeCommand = execDir.filePath(cmakeCommand);
  37. @@ -62,6 +69,7 @@ QCMake::QCMake(QObject* p)
  38. this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
  39. #endif
  40. this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
  41. + this->CMakeInstance->SetArgs(this->Args);
  42.  
  43. cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);
  44.  
  45. @@ -170,6 +178,7 @@ void QCMake::configure()
  46. this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings);
  47. this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode);
  48. this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode);
  49. + this->CMakeInstance->SetCacheArgs(this->Args);
  50. this->CMakeInstance->PreLoadCMakeFiles();
  51.  
  52. InterruptFlag = 0;
  53. diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
  54. index 93ac8ab..4f68eaf 100644
  55. --- a/Source/QtDialog/QCMake.h
  56. +++ b/Source/QtDialog/QCMake.h
  57. @@ -24,6 +24,8 @@
  58. #include <QStringList>
  59. #include <QMetaType>
  60. #include <QAtomicInt>
  61. +#include <vector>
  62. +#include <string>
  63.  
  64. class cmake;
  65.  
  66. @@ -133,6 +135,7 @@ signals:
  67.  
  68. protected:
  69. cmake* CMakeInstance;
  70. + std::vector<std::string> Args;
  71.  
  72. static bool interruptCallback(void*);
  73. static void progressCallback(const char* msg, float percent, void* cd);
  74. --
  75. 1.8.3.msysgit.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement