MCPcopy Create free account
hub / github.com/KDE/kdevelop / apply

Method apply

plugins/cmake/settings/cmakepreferences.cpp:136–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void 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
168void CMakePreferences::defaults()
169{

Callers

nothing calls this directly

Calls 15

currentBuildDirIndexFunction · 0.85
setCurrentEnvironmentFunction · 0.85
setCurrentInstallDirFunction · 0.85
setCurrentBuildTypeFunction · 0.85
setCurrentExtraArgumentsFunction · 0.85
currentBuildDirFunction · 0.85
currentInstallDirFunction · 0.85
currentBuildTypeFunction · 0.85
currentCMakeExecutableFunction · 0.85
currentEnvironmentFunction · 0.85

Tested by

no test coverage detected