Commit 4869cbe
committed
[commontk] cmake: Address build error by partially reverting AUTOMOC changes
Partially reverts dd82ba4 ("[commontk] cmake: Simplify build-system
leveraging AUTOMOC capability", 2025-10-23) to fix a build error
reported when AUTOMOC merges all `moc_*.cpp` into one Translation Unit
(TU) (`<target>_autogen/mocs_compilation*.cpp`).
This change includes:
- Reverting to manual specification of moc sources.
- Disabling AUTOMOC for specified sources to avoid QMetaTypeId
specialization conflicts.
This fixes the following error:
```
In file included from /path/to/Support/Qt/6.9.1/gcc_64/include/QtCore/qvariant.h:10,
from /path/to/Support/Qt/6.9.1/gcc_64/include/QtCore/qmetaobject.h:10,
from /path/to/Support/Qt/6.9.1/gcc_64/include/QtCore/QMetaMethod:1,
from /path/to/Projects/PythonQt-CTK/src/PythonQtUtils.h:49,
from /path/to/Projects/PythonQt-CTK/src/PythonQt.h:46,
from /path/to/Projects/PythonQt-CTK-cmake-Qt6-Release/PythonQt_autogen/CRAGYDUSE3/../../../CTK-Qt6-build/PythonQtGenerator-output-6.9.1/generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core0.h:1,
from /path/to/Projects/PythonQt-CTK-cmake-Qt6-Release/PythonQt_autogen/CRAGYDUSE3/moc_com_trolltech_qt_core0.cpp:9,
from /path/to/Projects/PythonQt-CTK-cmake-Qt6-Release/PythonQt_autogen/mocs_compilation.cpp:2:
/path/to/Support/Qt/6.9.1/gcc_64/include/QtPrintSupport/qprintengine.h:12:1: error: specialization of ‘QMetaTypeId<QMarginsF>’ after instantiation
12 | Q_DECLARE_METATYPE(QMarginsF)
| ^~~~~~~~~~~~~~~~~~
/path/to/Support/Qt/6.9.1/gcc_64/include/QtPrintSupport/qprintengine.h:12:1: error: redefinition of ‘struct QMetaTypeId<QMarginsF>’
/path/to/Support/Qt/6.9.1/gcc_64/include/QtCore/qmetatype.h:1232:8: note: previous definition of ‘struct QMetaTypeId<QMarginsF>’
```1 parent 9d9d06c commit 4869cbe
1 file changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
| |||
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
268 | 279 | | |
269 | 280 | | |
270 | 281 | | |
271 | 282 | | |
272 | 283 | | |
273 | 284 | | |
274 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
275 | 290 | | |
276 | 291 | | |
277 | 292 | | |
| |||
300 | 315 | | |
301 | 316 | | |
302 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
303 | 323 | | |
304 | 324 | | |
305 | 325 | | |
| |||
0 commit comments