diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2017-10-11 19:02:26 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2017-10-13 19:28:35 (GMT) |
commit | 96d642c7b87e303813b75aaa3412f8e532d2b925 (patch) | |
tree | 01965b8079a8b525ba9fd683cdf6eeaacc92185f /Source/QtDialog/QCMake.cxx | |
parent | 5de37a4a6474fa569e2ac28d5e9c164b6e7d2f46 (diff) | |
download | CMake-96d642c7b87e303813b75aaa3412f8e532d2b925.zip CMake-96d642c7b87e303813b75aaa3412f8e532d2b925.tar.gz CMake-96d642c7b87e303813b75aaa3412f8e532d2b925.tar.bz2 |
cmake-gui: Use cmake::Open to open generated project
Diffstat (limited to 'Source/QtDialog/QCMake.cxx')
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index d473d9b..7e94a27 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -115,6 +115,8 @@ void QCMake::setBinaryDirectory(const QString& _dir) if (toolset) { this->setToolset(QString::fromLocal8Bit(toolset)); } + + checkOpenPossible(); } } @@ -183,6 +185,26 @@ void QCMake::generate() #endif emit this->generateDone(err); + checkOpenPossible(); +} + +void QCMake::open() +{ +#ifdef Q_OS_WIN + UINT lastErrorMode = SetErrorMode(0); +#endif + + InterruptFlag = 0; + cmSystemTools::ResetErrorOccuredFlag(); + + auto successful = this->CMakeInstance->Open( + this->BinaryDirectory.toLocal8Bit().data(), false); + +#ifdef Q_OS_WIN + SetErrorMode(lastErrorMode); +#endif + + emit this->openDone(successful); } void QCMake::setProperties(const QCMakePropertyList& newProps) @@ -450,3 +472,10 @@ void QCMake::setWarnUnusedMode(bool value) { this->WarnUnusedMode = value; } + +void QCMake::checkOpenPossible() +{ + auto data = this->BinaryDirectory.toLocal8Bit().data(); + auto possible = this->CMakeInstance->Open(data, true); + emit openPossible(possible); +} |