| 134 | } |
| 135 | |
| 136 | void CMakePreferences::apply() |
| 137 | { |
| 138 | qCDebug(CMAKE) << "*******saving"; |
| 139 | |
| 140 | // the build directory list is incrementally maintained through createBuildDir() and removeBuildDir(). |
| 141 | // We won't rewrite it here based on the data from m_prefsUi->buildDirs. |
| 142 | CMake::removeOverrideBuildDirIndex( m_project, true ); // save current selection |
| 143 | int savedBuildDir = CMake::currentBuildDirIndex(m_project); |
| 144 | if (savedBuildDir < 0) { |
| 145 | // no build directory exists: skip any writing to config file as well as configuring |
| 146 | return; |
| 147 | } |
| 148 | |
| 149 | CMake::setCurrentEnvironment( m_project, m_prefsUi->environment->currentProfile() ); |
| 150 | |
| 151 | CMake::setCurrentInstallDir( m_project, Path(m_prefsUi->installationPrefix->text()) ); |
| 152 | const QString buildType = m_prefsUi->buildType->currentText(); |
| 153 | CMake::setCurrentBuildType(m_project, buildType); |
| 154 | CMake::setCurrentExtraArguments( m_project, m_prefsUi->extraArguments->currentText() ); |
| 155 | CMake::setCurrentCMakeExecutable( m_project, Path(m_prefsUi->cMakeExecutable->text()) ); |
| 156 | |
| 157 | qCDebug(CMAKE) << "writing to cmake config: using builddir " << CMake::currentBuildDirIndex(m_project); |
| 158 | qCDebug(CMAKE) << "writing to cmake config: builddir path " << CMake::currentBuildDir(m_project); |
| 159 | qCDebug(CMAKE) << "writing to cmake config: installdir " << CMake::currentInstallDir(m_project); |
| 160 | qCDebug(CMAKE) << "writing to cmake config: build type " << CMake::currentBuildType(m_project); |
| 161 | qCDebug(CMAKE) << "writing to cmake config: cmake executable " << CMake::currentCMakeExecutable(m_project); |
| 162 | qCDebug(CMAKE) << "writing to cmake config: environment " << CMake::currentEnvironment(m_project); |
| 163 | |
| 164 | //We run cmake on the builddir to generate it |
| 165 | configure(); |
| 166 | } |
| 167 | |
| 168 | void CMakePreferences::defaults() |
| 169 | { |
nothing calls this directly
no test coverage detected