From 93e7486fd633b77aabc5c6a170a05056b4fd4480 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 14 Dec 2023 16:11:24 +0100 Subject: [PATCH] CMake: Fix non-prefix debug exclusion check for additional info props MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The condition was checking if excluded_genex variables is not an empty string. But when the EXCLUDE_FROM_ALL property was unset, the value of excluded_genex would be "excluded_genex-NOTFOUND" which would fail the condition, and would end up always adding the generated code block. Instead of checking for an empty string, check if it's a truth-y value. This ensures not to add the code block when the property is unset. Amends 7540b4bd5634c9104a99f9b219531b1e3dd7942d Change-Id: I126c745e2e6eccad34171456c052a14cad9d887d Reviewed-by: Joerg Bornemann Reviewed-by: 🌴 Alexey Edelev 🌴 (cherry picked from commit cab76abc613b94c70121a1bc3b7f403dbd12af9d) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtTargetHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index c9775ae384a..96325825d81 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -853,7 +853,7 @@ endif() # the target. It is not built by default. if(NOT QT_WILL_INSTALL AND QT_FEATURE_debug_and_release) get_target_property(excluded_genex ${target} EXCLUDE_FROM_ALL) - if(NOT excluded_genex STREQUAL "") + if(excluded_genex) string(APPEND content " # ${full_target} is not built by default in the Debug configuration. Check existence. get_target_property(_qt_imported_location ${full_target} IMPORTED_LOCATION_DEBUG)