From e3bdbc84ec5ada04e436dba9067d902e2c6c030a Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Wed, 14 Jul 2021 14:28:12 +0200 Subject: [PATCH] CMakeLists: fixed potential linking errors around quotient_common.h quotient_common.h has Q_NAMESPACE but no own compilation unit, and moc was not called on it either - using metaobject data on an enumeration defined in that file leads to a linking error due to sharedMetaObject not being defined. The fix makes so that the file is detected by automoc with the respective definition being generated. Cherry-picked from a83ec900 (0.6.x branch). --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 285862df4..deb50aea7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,6 +122,11 @@ endif () # Set up source files list(APPEND lib_SRCS + # This .h is special in that it declares a Q_NAMESPACE but has no .cpp + # where staticMetaObject for that namespace would be defined; passing it + # to add_library (see below) puts it on the automoc radar, producing + # a compilation unit with the needed definition. + lib/quotient_common.h lib/networkaccessmanager.cpp lib/connectiondata.cpp lib/connection.cpp