Add internal property to store Qt namespace

In some cases it might be useful to use the value of Qt namespace in
CMake files. Currently the value is only stored inside Core target
compile definitions. This adds the internal property _qt_namespace to
the Core target and exports it.

Change-Id: Ic0454f0ce6b8c65b5a186981463d3977169b022e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
Alexey Edelev 2021-10-25 20:02:54 +02:00
parent f670e483c1
commit 6adaaa7745
1 changed files with 2 additions and 0 deletions

View File

@ -288,6 +288,8 @@ add_dependencies(Core qmodule_pri)
if (NOT QT_NAMESPACE STREQUAL "")
target_compile_definitions(Core PUBLIC "QT_NAMESPACE=${QT_NAMESPACE}")
set_target_properties(Core PROPERTIES _qt_namespace "${QT_NAMESPACE}")
set_property(TARGET Core APPEND PROPERTY EXPORT_PROPERTIES _qt_namespace)
endif()
qt_generate_qconfig_cpp(global/qconfig.cpp.in global/qconfig.cpp)