Merge remote-tracking branch 'origin/9.0'

Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/texteditor/texteditor.cpp

Change-Id: I9c8f1331be3f5442f1fd28aeb0a9bc07128629d1
This commit is contained in:
Eike Ziller
2022-12-20 11:05:01 +01:00
21 changed files with 99 additions and 44 deletions

View File

@@ -441,6 +441,28 @@ static QString extractVisualStudioPlatformFromConfig(const CMakeConfig &config)
return platform;
}
void updateCompilerPaths(CMakeConfig &config, const Environment &env)
{
auto updateRelativePath = [&config, env](const QByteArray &key) {
FilePath pathValue = config.filePathValueOf(key);
if (pathValue.isAbsolutePath() || pathValue.isEmpty())
return;
pathValue = env.searchInPath(pathValue.fileName());
auto it = std::find_if(config.begin(), config.end(), [&key](const CMakeConfigItem &item) {
return item.key == key;
});
QTC_ASSERT(it != config.end(), return);
it->value = pathValue.path().toUtf8();
};
updateRelativePath("CMAKE_C_COMPILER");
updateRelativePath("CMAKE_CXX_COMPILER");
}
QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
QString *warningMessage) const
{
@@ -518,6 +540,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
}
} else {
config = cache;
updateCompilerPaths(config, env);
config << CMakeConfigItem("CMAKE_COMMAND",
CMakeConfigItem::PATH,
configurePreset.cmakeExecutable.value().toUtf8());