From 27d74cdc75442d05247383fc8489fbfa16711d5b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 24 Mar 2022 12:05:15 +0100 Subject: [PATCH] CMake: Fix handling of the CROSSCOMPILING_EMULATOR property CROSSCOMPILING_EMULATOR is a target property, not a test property. Fixes: QTBUG-87864 Change-Id: Icb07e9ed71a6bcbfceb7aa2116bf56eaa0a545c6 Reviewed-by: Alexandru Croitor (cherry picked from commit 02e5b0ffda7dded9af65b7f09a8d1a7ddfe8fda2) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtTestHelpers.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index a433199305d..934dce9d4c4 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -484,8 +484,9 @@ for this function. Will be ignored") # Prepend emulator to test command in generated cmake script instead. Keep in mind that # CROSSCOMPILING_EMULATOR don't check if actual cross compilation is configured, # emulator is prepended independently. - if(CMAKE_CROSSCOMPILING) - get_test_property(${arg_NAME} CROSSCOMPILING_EMULATOR crosscompiling_emulator) + set(crosscompiling_emulator "") + if(CMAKE_CROSSCOMPILING AND TARGET ${arg_NAME}) + get_target_property(crosscompiling_emulator ${arg_NAME} CROSSCOMPILING_EMULATOR) if(NOT crosscompiling_emulator) set(crosscompiling_emulator "") else()