From d6a8560eaeedf889c01f2192b31a4ebf8e8f7fb9 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Wed, 27 Jan 2021 12:20:26 +1100 Subject: [PATCH] Ensure Core target has INTERFACE_QT_COORD_TYPE property defined In order for other Qt modules to be able to reliably use this property, it needs to be defined under all supported scenarios. Previously, it would only have been defined for a per-repo build and not for a top level superbuild. The only place it was being set was in the Qt6CoreConfigExtras.cmake file and only when QT_NO_CREATE_TARGETS was false (so it wouldn't be defined for examples even in a per-repo build). It was also noticed that INTERFACE_QT_MAJOR_VERSION was also being handled in Qt6CoreConfigExtras.cmake, but this was not needed. This was already being done as part of a call to qt_autogen_tools_initial_setup() which occurs inside qt_internal_add_module(). Fixes: QTBUG-90617 Change-Id: I589316ffb8138bd2df8a1d49fdd6335d2e2836f1 Reviewed-by: Joerg Bornemann --- src/corelib/CMakeLists.txt | 3 +++ src/corelib/Qt6CoreConfigExtras.cmake.in | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 1abe6588d91..97aaff3cfed 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -277,6 +277,9 @@ endif() qt_generate_qconfig_cpp() +set_target_properties(Core PROPERTIES INTERFACE_QT_COORD_TYPE "${QT_COORD_TYPE}") +set_property(TARGET Core APPEND PROPERTY COMPATIBLE_INTERFACE_STRING QT_COORD_TYPE) + # Handle qtConfig(thread): CONFIG += thread like in qt.prf. # Aka if the feature is enabled, publically link against the threading library. # This also ensures the link flag is in the .prl file. diff --git a/src/corelib/Qt6CoreConfigExtras.cmake.in b/src/corelib/Qt6CoreConfigExtras.cmake.in index 5c4468fa106..e7892bbcc3f 100644 --- a/src/corelib/Qt6CoreConfigExtras.cmake.in +++ b/src/corelib/Qt6CoreConfigExtras.cmake.in @@ -13,11 +13,6 @@ endif() # set(_qt5_corelib_extra_includes) if (NOT QT_NO_CREATE_TARGETS) - set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_MAJOR_VERSION @PROJECT_VERSION_MAJOR@) - set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_COORD_TYPE @QT_COORD_TYPE@) - set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY - COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE - ) if (NOT "@QT_NAMESPACE@" STREQUAL "") set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=@QT_NAMESPACE@) endif()