| 396 | } |
| 397 | |
| 398 | bool CMakeSetupDialog::prepareConfigure() |
| 399 | { |
| 400 | // make sure build directory exists |
| 401 | QString bindir = this->CMakeThread->cmakeInstance()->binaryDirectory(); |
| 402 | QDir dir(bindir); |
| 403 | if (!dir.exists()) { |
| 404 | QString msg = tr("Build directory does not exist, " |
| 405 | "should I create it?\n\n" |
| 406 | "Directory: "); |
| 407 | msg += bindir; |
| 408 | QString title = tr("Create Directory"); |
| 409 | QMessageBox::StandardButton btn; |
| 410 | btn = QMessageBox::information(this, title, msg, |
| 411 | QMessageBox::Yes | QMessageBox::No); |
| 412 | if (btn == QMessageBox::No) { |
| 413 | return false; |
| 414 | } |
| 415 | if (!dir.mkpath(".")) { |
| 416 | QMessageBox::information( |
| 417 | this, tr("Create Directory Failed"), |
| 418 | QString(tr("Failed to create directory %1")).arg(dir.path()), |
| 419 | QMessageBox::Ok); |
| 420 | |
| 421 | return false; |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | // if no generator, prompt for it and other setup stuff |
| 426 | if (this->CMakeThread->cmakeInstance()->generator().isEmpty()) { |
| 427 | if (!this->setupFirstConfigure()) { |
| 428 | return false; |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | // remember paths |
| 433 | this->addBinaryPath( |
| 434 | this->CMakeThread->cmakeInstance()->relativeBinaryDirectory()); |
| 435 | QSettings settings; |
| 436 | settings.beginGroup("Settings/StartPath"); |
| 437 | settings.setValue("WhereSource", |
| 438 | this->CMakeThread->cmakeInstance()->sourceDirectory()); |
| 439 | |
| 440 | return true; |
| 441 | } |
| 442 | |
| 443 | void CMakeSetupDialog::exitLoop(int err) |
| 444 | { |
nothing calls this directly
no test coverage detected