From ed200237604377fee64393ba79c065a2d18c786b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 18 Jun 2020 11:06:14 +0200 Subject: 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 --- cmake/QtBuild.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmake') 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} -- cgit v1.2.3