From d35c8fe52149f0adb7c81da804a5b98cc54a0abe Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 1 Nov 2013 09:40:27 +0100 Subject: CMake: Add the qreal typedef type to the Qt5::Core target. This way, a Qt compiled with qreal=float and one linked with qreal=double can not be linked by a single downstream. That is diagnosed at cmake-time. Change-Id: I9183dbcfef181fadea5321d3154948e8258e4a2a Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- configure | 1 + src/corelib/Qt5CoreConfigExtras.cmake.in | 3 ++- tools/configure/configureapp.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 4adaa77403..81e2a93c28 100755 --- a/configure +++ b/configure @@ -6713,6 +6713,7 @@ host_build { QT_CPU_FEATURES.$CFG_ARCH = $CFG_CPUFEATURES } EOF +echo "QT_COORD_TYPE = $CFG_QREAL" >> "$QTMODULE.tmp" if [ -n "$QT_CFLAGS_PSQL" ]; then echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$QTMODULE.tmp" diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 2d87783107..1e00c74aa6 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -51,8 +51,9 @@ set(Qt5Core_MOC_EXECUTABLE Qt5::moc) set(Qt5Core_RCC_EXECUTABLE Qt5::rcc) set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_MAJOR_VERSION 5) +set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE) set_property(TARGET Qt5::Core APPEND PROPERTY - COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION + COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE ) include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5CoreConfigExtrasMkspecDir.cmake\") diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 35231aecd2..c67b245228 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2850,6 +2850,7 @@ void Configure::generateCachefile() moduleStream << " QT_CPU_FEATURES." << dictionary["QT_ARCH"] << " = " << dictionary["QT_CPU_FEATURES"] << endl; moduleStream << "}" << endl; + moduleStream << "QT_COORD_TYPE += " << dictionary["QREAL"] << endl; if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE") moduleStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl; -- cgit v1.2.3