From e06883d102f06bf99ffcf29845fcc4e3e0622d62 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 6 Feb 2018 00:36:00 +0100 Subject: [PATCH] Fix annoying warning Summary: Warning for every plugin was: The file includes the moc file "generator_tiff.moc", but does not contain a Q_OBJECT, Q_GADGET, Q_NAMESPACE, K_PLUGIN_FACTORY_WITH_JSON, K_PLUGIN_FACTORY, K_PLUGIN_FACTORY_WITH_JSON or K_PLUGIN_FACTORY macro. Test Plan: Built Reviewers: aacid Reviewed By: aacid Subscribers: #okular Tags: #okular Differential Revision: https://phabricator.kde.org/D10022 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d76f67e0c..609ebc6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,12 @@ else() add_definitions(-DHAVE_SPEECH) endif() +if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") + # CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros. + # 3.10+ lets us provide more macro names that require automoc. + list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "OKULAR_EXPORT_PLUGIN") +endif() + find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Archive Bookmarks