summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmir Masoud Abdol <amir.abdol@qt.io>2023-02-28 10:32:13 +0100
committerAmir Masoud Abdol <amir.abdol@qt.io>2023-03-01 19:49:34 +0100
commit6964c01d154f19fb11691d248d9f1ed680f9cd6d (patch)
treee59f189450a6a5c8c12a074855ae35ad7c8cdddb /src
parent4efcaaa764a99bacebe0ea6b696d7711a64de35b (diff)
Avoid resetting CMAKE_AUTOMOC_MACRO_NAMES
Instead of overwriting the CMAKE_AUTOMOC_MACRO_NAMES, we try to append our desired moc names to it, and don't get rid of what's there. Thanks for Friedrich W. H. Kossebau for filling a descriptive bug report and offering a solution as well. Fixes: QTBUG-110497 Change-Id: I582af431151cacfe24085b890ae9dba0a0e53f3f Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 38ee9ee8497291c899c2a72e0ed24bfffe9ced4e) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/Qt6CoreConfigExtras.cmake.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/Qt6CoreConfigExtras.cmake.in b/src/corelib/Qt6CoreConfigExtras.cmake.in
index bd273da0cf..4626283757 100644
--- a/src/corelib/Qt6CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt6CoreConfigExtras.cmake.in
@@ -20,7 +20,8 @@ if (NOT QT_NO_CREATE_TARGETS)
set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)
endif()
-set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")
+list(APPEND CMAKE_AUTOMOC_MACRO_NAMES Q_OBJECT Q_GADGET Q_NAMESPACE Q_NAMESPACE_EXPORT)
+list(REMOVE_DUPLICATES CMAKE_AUTOMOC_MACRO_NAMES)
# install layout information, following what qmake -query provides
get_filename_component(QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../@QT_INVERSE_CONFIG_INSTALL_DIR@ ABSOLUTE)