summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-08-18 10:59:03 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-08-19 08:28:50 +0200
commit5f729da74a5c12a8d33389dcc874c8277044abe0 (patch)
tree52b2d498e949155cdc43efd2a48066b0c7d7ceec /cmake
parent3911be61602695ed65e33e54bee38ee8bcd92539 (diff)
CMake: Implement configure -qreal <type>
The configure argument -qreal <type> maps to the CMake argument -DQT_COORD_TYPE=<type>. Fixes: QTBUG-83325 Change-Id: I94970f31ccfb241b1dd4f1d9b6cef25d6684dc05 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake4
-rw-r--r--cmake/QtPriHelpers.cmake2
-rw-r--r--cmake/QtProcessConfigureArgs.cmake1
-rw-r--r--cmake/configure-cmake-mapping.md2
4 files changed, 7 insertions, 2 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index d85acbd1c9..32277a13cc 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -142,6 +142,10 @@ else()
set(QT_STAGING_PREFIX "${CMAKE_INSTALL_PREFIX}")
endif()
+if(PROJECT_NAME STREQUAL "QtBase")
+ set(QT_COORD_TYPE double CACHE STRING "Type of qreal")
+endif()
+
function(qt_internal_set_up_global_paths)
# Compute the values of QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR, QT_CONFIG_INSTALL_DIR
# taking into account whether the current build is a prefix build or a non-prefix build,
diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake
index 1e3b12e661..f1723cd495 100644
--- a/cmake/QtPriHelpers.cmake
+++ b/cmake/QtPriHelpers.cmake
@@ -652,7 +652,7 @@ CONFIG += ${private_config_joined}
string(APPEND content "PKG_CONFIG_EXECUTABLE = ${PKG_CONFIG_EXECUTABLE}\n")
endif()
- # TODO: Write QT_COORD_TYPE once we support setting it.
+ string(APPEND content "QT_COORD_TYPE = ${QT_COORD_TYPE}\n")
qt_get_build_parts(build_parts)
string(REPLACE ";" " " build_parts "${build_parts}")
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index de35b2f5df..743e8e3eb7 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -534,6 +534,7 @@ translate_boolean_input(precompile_header BUILD_WITH_PCH)
translate_boolean_input(ccache QT_USE_CCACHE)
translate_boolean_input(shared BUILD_SHARED_LIBS)
translate_string_input(qt_namespace QT_NAMESPACE)
+translate_string_input(qreal QT_COORD_TYPE)
translate_path_input(prefix CMAKE_INSTALL_PREFIX)
translate_path_input(extprefix CMAKE_STAGING_PREFIX)
foreach(kind bin lib archdata libexec qml data doc translation sysconf examples tests)
diff --git a/cmake/configure-cmake-mapping.md b/cmake/configure-cmake-mapping.md
index 874b85e2e3..e0edfe98e7 100644
--- a/cmake/configure-cmake-mapping.md
+++ b/cmake/configure-cmake-mapping.md
@@ -56,7 +56,7 @@ The effort of this is tracked in QTBUG-85373 and QTBUG-85349.
| -c++std c++2a | -DFEATURE_cxx2a=ON | |
| -sse2/sse3/-ssse3/-sse4.1 | | |
| -mips_dsp/-mips_dspr2 | | |
-| -qreal <type> | | |
+| -qreal <type> | -DQT_COORD_TYPE=<type> | |
| -R <string> | -DQT_EXTRA_RPATHS=path1;path2 | |
| -rpath | negative CMAKE_SKIP_BUILD_RPATH | |
| | negative CMAKE_SKIP_INSTALL_RPATH | |