forked from qt-creator/qt-creator
CMakePM: configure presets review fixes
Amends 2ab1e76ca9
Change-Id: Id10f0d4da6a60223d68af3cea6c5263f7c8c62f2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -124,10 +124,9 @@ QStringList CMakeProjectImporter::importCandidates()
|
|||||||
if (configPreset.hidden.value())
|
if (configPreset.hidden.value())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const QString presetDirName = m_presetsTempDir.filePath(configPreset.name).toString();
|
const FilePath configPresetDir = m_presetsTempDir.filePath(configPreset.name);
|
||||||
const QDir presetDir;
|
configPresetDir.createDir();
|
||||||
presetDir.mkpath(presetDirName);
|
candidates << configPresetDir.toString();
|
||||||
candidates << presetDirName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStringList finalists = Utils::filteredUnique(candidates);
|
const QStringList finalists = Utils::filteredUnique(candidates);
|
||||||
@@ -138,16 +137,11 @@ QStringList CMakeProjectImporter::importCandidates()
|
|||||||
static CMakeConfig configurationFromPresetProbe(
|
static CMakeConfig configurationFromPresetProbe(
|
||||||
const FilePath &importPath, const PresetsDetails::ConfigurePreset &configurePreset)
|
const FilePath &importPath, const PresetsDetails::ConfigurePreset &configurePreset)
|
||||||
{
|
{
|
||||||
QFile cmakeListTxt(importPath.pathAppended("CMakeLists.txt").toString());
|
const FilePath cmakeListTxt = importPath / "CMakeLists.txt";
|
||||||
if (!cmakeListTxt.open(QIODevice::WriteOnly)) {
|
cmakeListTxt.writeFileContents(QByteArray("cmake_minimum_required(VERSION 3.15)\n"
|
||||||
return {};
|
"\n"
|
||||||
}
|
"project(preset-probe)\n"
|
||||||
|
"\n"));
|
||||||
cmakeListTxt.write(QByteArray("cmake_minimum_required(VERSION 3.15)\n"
|
|
||||||
"\n"
|
|
||||||
"project(preset-probe)\n"
|
|
||||||
"\n"));
|
|
||||||
cmakeListTxt.close();
|
|
||||||
|
|
||||||
QtcProcess cmake;
|
QtcProcess cmake;
|
||||||
cmake.setTimeoutS(30);
|
cmake.setTimeoutS(30);
|
||||||
|
|||||||
Reference in New Issue
Block a user