summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-06-17 10:11:23 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-06-17 15:13:43 +0200
commit435fe4b13de43c2a3fd07f9478becf2350887e54 (patch)
tree6b0a4f04c01c887b21f2cfaf5fe690e426b259aa
parent3452b08df6a3802c96b06651f9a530d55cbe7477 (diff)
CMake: Add additional info which was missing in qconfig.pri
Mostly compiler version numbers. Task-number: QTBUG-84781 Change-Id: I10e92fdfd4e603c9b763a51a0e09b6c4a2c75ac7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--cmake/QtBuild.cmake36
-rw-r--r--cmake/QtPlatformSupport.cmake1
2 files changed, 37 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 37d4b118e9..cd459f251f 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1105,6 +1105,42 @@ function(qt_generate_global_config_pri_file)
if(QT_NAMESPACE)
list(APPEND extra_statements "QT_NAMESPACE = ${QT_NAMESPACE}")
endif()
+ # TODO: Add libinfix support.
+
+ # TODO: Add QT_EMCC_VERSION when WASM is ported over.
+ if(APPLECLANG)
+ set(compiler_version_major_var_name "QT_APPLE_CLANG_MAJOR_VERSION")
+ set(compiler_version_minor_var_name "QT_APPLE_CLANG_MINOR_VERSION")
+ set(compiler_version_patch_var_name "QT_APPLE_CLANG_PATCH_VERSION")
+ elseif(CLANG)
+ set(compiler_version_major_var_name "QT_CLANG_MAJOR_VERSION")
+ set(compiler_version_minor_var_name "QT_CLANG_MINOR_VERSION")
+ set(compiler_version_patch_var_name "QT_CLANG_PATCH_VERSION")
+ elseif(GCC)
+ set(compiler_version_major_var_name "QT_GCC_MAJOR_VERSION")
+ set(compiler_version_minor_var_name "QT_GCC_MINOR_VERSION")
+ set(compiler_version_patch_var_name "QT_GCC_PATCH_VERSION")
+ elseif(ICC)
+ set(compiler_version_major_var_name "QT_ICC_MAJOR_VERSION")
+ set(compiler_version_minor_var_name "QT_ICC_MINOR_VERSION")
+ set(compiler_version_patch_var_name "QT_ICC_PATCH_VERSION")
+ elseif(MSVC)
+ set(compiler_version_major_var_name "QT_MSVC_MAJOR_VERSION")
+ set(compiler_version_minor_var_name "QT_MSVC_MINOR_VERSION")
+ set(compiler_version_patch_var_name "QT_MSVC_PATCH_VERSION")
+ endif()
+
+ if(compiler_version_major_var_name)
+ list(APPEND extra_statements
+ "${compiler_version_major_var_name} = ${QT_COMPILER_VERSION_MAJOR}")
+ list(APPEND extra_statements
+ "${compiler_version_minor_var_name} = ${QT_COMPILER_VERSION_MINOR}")
+ list(APPEND extra_statements
+ "${compiler_version_patch_var_name} = ${QT_COMPILER_VERSION_PATCH}")
+ endif()
+
+ list(APPEND extra_statements "QT_EDITION = Open Source")
+
if(extra_statements)
string (REPLACE ";" "\n" extra_statements "${extra_statements}")
endif()
diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake
index 7d057b2ca4..1c428afe73 100644
--- a/cmake/QtPlatformSupport.cmake
+++ b/cmake/QtPlatformSupport.cmake
@@ -30,6 +30,7 @@ qt_set01(MACOS APPLE AND NOT UIKIT)
qt_set01(GCC CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
qt_set01(CLANG CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+qt_set01(APPLECLANG CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
qt_set01(ICC CMAKE_C_COMPILER MATCHES "icc|icl")
qt_set01(QCC CMAKE_C_COMPILER MATCHES "qcc") # FIXME: How to identify this?