diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-10-26 14:50:23 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-10-27 19:26:35 +0100 |
commit | f65abc63441bf821c4e4619b842c74b6d5074cbd (patch) | |
tree | cc31a46b1362ab7794884d414007b1736e236358 /cmake | |
parent | c61f90fbe625ab2bf5ad044b43822f0df8887e80 (diff) |
CMake: Export QT_QPA_DEFAULT_PLATFORM in QtBuildInternalsExtra
The value is useful for QPA plugins built in repos other than qtbase,
to decide if it should be a default plugin or not.
Currently useful for qtwayland.
Also export a qmake value assignment when doing static builds, just
like src/gui/configure.pri does.
Change-Id: I1253f1a7e178b24b16e2615ba20d1e92b0b87b1a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtPostProcessHelpers.cmake | 8 | ||||
-rw-r--r-- | cmake/QtPriHelpers.cmake | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index 4f8106dfae..6aeb1d72c8 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -530,6 +530,14 @@ endif()\n") "set(ECM_ENABLE_SANITIZERS \"${ECM_ENABLE_SANITIZERS}\" CACHE BOOL \"\" FORCE)\n") endif() + # Save the default qpa platform. + # Used by qtwayland/src/plugins/platforms/qwayland-generic/CMakeLists.txt. Otherwise + # the DEFAULT_IF condition is evaluated incorrectly. + if(DEFINED QT_QPA_DEFAULT_PLATFORM) + string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS + "set(QT_QPA_DEFAULT_PLATFORM \"${QT_QPA_DEFAULT_PLATFORM}\" CACHE STRING \"\")\n") + endif() + # Rpath related things that need to be re-used when building other repos. string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "set(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_RPATH}\" CACHE STRING \"\")\n") diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake index 9face47756..7760951f44 100644 --- a/cmake/QtPriHelpers.cmake +++ b/cmake/QtPriHelpers.cmake @@ -240,6 +240,10 @@ function(qt_generate_module_pri_file target) list(FILTER target_defines EXCLUDE REGEX "\\$<TARGET_PROPERTY:[^,>]+>") list(JOIN target_defines " " joined_target_defines) + if(NOT QT_BUILD_SHARED_LIBS AND target STREQUAL Gui) + set(extra_assignments "QT_DEFAULT_QPA_PLUGIN = q${QT_QPA_DEFAULT_PLATFORM}") + endif() + file(GENERATE OUTPUT "${pri_file_name}" CONTENT @@ -257,6 +261,7 @@ QT.${config_module_name}.module_config = ${joined_module_internal_config} QT.${config_module_name}.DEFINES = ${joined_target_defines} QT.${config_module_name}.enabled_features = ${enabled_features} QT.${config_module_name}.disabled_features = ${disabled_features}${module_build_config} +${extra_assignments} QT_CONFIG += ${enabled_features} QT_MODULES += ${config_module_name_base} " |