From 02e5b0ffda7dded9af65b7f09a8d1a7ddfe8fda2 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 Pick-to: 6.2 6.3 Change-Id: Icb07e9ed71a6bcbfceb7aa2116bf56eaa0a545c6 Reviewed-by: Alexandru Croitor --- cmake/QtTestHelpers.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 8a0c65739d0..a8d6682e023 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -516,8 +516,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()