From 42c8e82b4db07179babfca11a3e4ef493a28557b Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 5 Feb 2024 14:40:27 +0100 Subject: [PATCH] CMakePM: fix optional check Change-Id: I4145b1f29a63bd69fefb0385aff92c6a23939b5f Reviewed-by: Cristian Adam Reviewed-by: Christian Stenger --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index b102aa2d2ac..f93f41e3e88 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -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 // then qt_add_qml_module function should be used - if (auto preferred = findFunction(*cmakeListFile, qtAddModule); !preferred.has_value()) - function = preferred; + function = findFunction(*cmakeListFile, qtAddModule).value_or(*function); const QString newSourceFiles = newFilesForFunction(function->LowerCaseName(), filePaths,