diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-08-25 16:43:02 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-01 17:08:15 (GMT) |
commit | 786e2695cb68402d44357002b438c95229c4fb19 (patch) | |
tree | 7b008945264d33ab95f5e83f5b1a3fd66d2aea98 | |
parent | 636e6c4ef7e79113802714dbc7ade77d4f04e809 (diff) | |
download | CMake-786e2695cb68402d44357002b438c95229c4fb19.zip CMake-786e2695cb68402d44357002b438c95229c4fb19.tar.gz CMake-786e2695cb68402d44357002b438c95229c4fb19.tar.bz2 |
Add warn-unused to the Qt interface
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 12 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.h | 2 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 14 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.h | 6 |
4 files changed, 34 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index a5510af..a09504d 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -120,6 +120,12 @@ CMakeSetupDialog::CMakeSetupDialog() this->WarnUninitializedAction = OptionsMenu->addAction(tr("&Warn Uninitialized (--warn-uninitialized)")); this->WarnUninitializedAction->setCheckable(true); + this->WarnUnusedAction = + OptionsMenu->addAction(tr("&Warn Unused (--warn-unused)")); + this->WarnUnusedAction->setCheckable(true); + this->WarnUnusedAllAction = + OptionsMenu->addAction(tr("&Warn Unused All (--warn-unused-all)")); + this->WarnUnusedAllAction->setCheckable(true); QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output")); debugAction->setCheckable(true); @@ -247,6 +253,12 @@ void CMakeSetupDialog::initialize() QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)), this->CMakeThread->cmakeInstance(), SLOT(setWarnUninitializedMode(bool))); + QObject::connect(this->WarnUnusedAction, SIGNAL(triggered(bool)), + this->CMakeThread->cmakeInstance(), + SLOT(setWarnUnusedMode(bool))); + QObject::connect(this->WarnUnusedAllAction, SIGNAL(triggered(bool)), + this->CMakeThread->cmakeInstance(), + SLOT(setWarnUnusedAllMode(bool))); if(!this->SourceDirectory->text().isEmpty() || !this->BinaryDirectory->lineEdit()->text().isEmpty()) diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 4c161d9..f937248 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -94,6 +94,8 @@ protected: QAction* GenerateAction; QAction* SuppressDevWarningsAction; QAction* WarnUninitializedAction; + QAction* WarnUnusedAction; + QAction* WarnUnusedAllAction; QAction* InstallForCommandLineAction; State CurrentState; diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 8d24c1c2..1f9fa3d 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -29,6 +29,8 @@ QCMake::QCMake(QObject* p) { this->SuppressDevWarnings = false; this->WarnUninitializedMode = false; + this->WarnUnusedMode = false; + this->WarnUnusedAllMode = false; qRegisterMetaType<QCMakeProperty>(); qRegisterMetaType<QCMakePropertyList>(); @@ -167,6 +169,8 @@ void QCMake::configure() this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings); std::cerr << "set warn uninitialized " << this->WarnUninitializedMode << "\n"; this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode); + this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode); + this->CMakeInstance->SetDefaultToUsed(!this->WarnUnusedAllMode); this->CMakeInstance->PreLoadCMakeFiles(); cmSystemTools::ResetErrorOccuredFlag(); @@ -425,3 +429,13 @@ void QCMake::setWarnUninitializedMode(bool value) { this->WarnUninitializedMode = value; } + +void QCMake::setWarnUnusedMode(bool value) +{ + this->WarnUnusedMode = value; +} + +void QCMake::setWarnUnusedAllMode(bool value) +{ + this->WarnUnusedAllMode = value; +} diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 6d2b2ff..6056a8c 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -90,6 +90,10 @@ public slots: void setSuppressDevWarnings(bool value); /// set whether to run cmake with warnings about uninitialized variables void setWarnUninitializedMode(bool value); + /// set whether to run cmake with warnings about unused variables + void setWarnUnusedMode(bool value); + /// set whether to run cmake with warnings about all unused variables + void setWarnUnusedAllMode(bool value); public: /// get the list of cache properties @@ -136,6 +140,8 @@ protected: bool&, void* cd); bool SuppressDevWarnings; bool WarnUninitializedMode; + bool WarnUnusedMode; + bool WarnUnusedAllMode; QString SourceDirectory; QString BinaryDirectory; QString Generator; |