CMakePM: fix optional check

Change-Id: I4145b1f29a63bd69fefb0385aff92c6a23939b5f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2024-02-05 14:40:27 +01:00
parent c28e37453e
commit 42c8e82b4d

View File

@@ -673,8 +673,7 @@ bool CMakeBuildSystem::addSrcFiles(Node *context, const FilePaths &filePaths, Fi
}; };
// Special case: when qt_add_executable and qt_add_qml_module use the same target name // Special case: when qt_add_executable and qt_add_qml_module use the same target name
// then qt_add_qml_module function should be used // then qt_add_qml_module function should be used
if (auto preferred = findFunction(*cmakeListFile, qtAddModule); !preferred.has_value()) function = findFunction(*cmakeListFile, qtAddModule).value_or(*function);
function = preferred;
const QString newSourceFiles = newFilesForFunction(function->LowerCaseName(), const QString newSourceFiles = newFilesForFunction(function->LowerCaseName(),
filePaths, filePaths,