summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-06-18 11:06:14 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-06-18 12:58:00 +0200
commited200237604377fee64393ba79c065a2d18c786b (patch)
tree52ce0e7bf21c4aec2c801f45599ecf60c0b75131 /cmake
parentf1beb28c461ba162d27e87bc7a23183989a5b9fd (diff)
CMake: Fix namespace builds for qmake mixing
While we recorded the namespace define in the CMake generated Targets file, we also have to record it in qt_lib_core.pri, so that qmake knows to use the define when building other modules / apps. It does scare me what other MODULE_DEFINES we might be missing, and that we should perhaps put all public modules defines into the generated module .pri files. Amends 3452b08df6a3802c96b06651f9a530d55cbe7477 Task-number: QTBUG-84781 Task-number: QTBUG-84881 Change-Id: I3175aa9991a06a4541eb0dd153ba2e6e58c019ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 95a84f7fc0..d681459444 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -831,6 +831,11 @@ function(qt_generate_module_pri_file target)
qt_path_join(pri_file_name "${target_path}" "qt_lib_${config_module_name}.pri")
list(APPEND pri_files "${pri_file_name}")
+ set(module_extra_defines "")
+ if(config_module_name STREQUAL core AND QT_NAMESPACE)
+ set(module_extra_defines "QT_NAMESPACE=${QT_NAMESPACE}")
+ endif()
+
file(GENERATE
OUTPUT "${pri_file_name}"
CONTENT
@@ -845,7 +850,7 @@ QT.${config_module_name}.plugin_types = ${module_plugin_types}
QT.${config_module_name}.depends = ${public_module_dependencies}
QT.${config_module_name}.uses =
QT.${config_module_name}.module_config = ${joined_module_internal_config}
-QT.${config_module_name}.DEFINES = QT_${module_define}_LIB
+QT.${config_module_name}.DEFINES = QT_${module_define}_LIB ${module_extra_defines}
QT.${config_module_name}.enabled_features = ${enabled_features}
QT.${config_module_name}.disabled_features = ${disabled_features}${module_build_config}
QT_CONFIG += ${enabled_features}