Commit 2642e0d9 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use ecm_setup_qtplugin_macro_names

Summary:
Avoids all the explicit boilerplate needed, ensures the dependency on
the JSON file ia also set and allows simple export of the setup
in the installed CMake config file, so other projects importing
the config file have the respective CMake macros set as recommended.

Reviewers: dvratil, mlaurent

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28640
parent 9a12a611
......@@ -40,6 +40,7 @@ include(CheckSymbolExists)
include(KDEPackageAppTemplates)
include(ECMMarkNonGuiExecutable)
include(ECMAddTests)
include(ECMSetupQtPluginMacroNames)
include(AkonadiMacros)
......@@ -119,6 +120,13 @@ if(BUILD_TESTING)
add_definitions(-DBUILD_TESTING)
endif()
ecm_setup_qtplugin_macro_names(
JSON_ARG2
"AKONADI_AGENTCONFIG_FACTORY"
CONFIG_CODE_VARIABLE
PACKAGE_SETUP_AUTOMOC_VARIABLES
)
# Make sure the KF5Akonadi_DATA_DIR is absolute before passing it to KF5AkonadiConfig.cmake.in
# otherwise build fails either on OSX CI, or for normal users
if (IS_ABSOLUTE "${KDE_INSTALL_DATADIR_KF5}")
......
......@@ -35,12 +35,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/KF5AkonadiMacros.cmake)
# The directory where akonadi-xml.xsd and kcfg2dbus.xsl are installed
set(KF5Akonadi_DATA_DIR "@PACKAGE_KF5Akonadi_DATA_DIR@")
####################################################################################
# CMAKE_AUTOMOC
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 AKONADI_AGENTCONFIG_FACTORY)
endif()
@PACKAGE_SETUP_AUTOMOC_VARIABLES@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment