Prevent cmake 3.10+ warning about moc include & Plasma plugin macros

This commit is contained in:
Friedrich W. H. Kossebau 2017-12-23 16:46:04 +01:00
parent 3889edd6d6
commit f78eee320c
2 changed files with 27 additions and 0 deletions

View File

@ -134,6 +134,27 @@ endif()
#########################################################################
set(Plasma_AUTOMOC_MACRO_NAMES
"K_EXPORT_PLASMA_SERVICE"
"K_EXPORT_PLASMA_SERVICE_WITH_JSON"
"K_EXPORT_PLASMA_APPLET"
"K_EXPORT_PLASMA_APPLET_WITH_JSON"
"K_EXPORT_PLASMA_PACKAGE"
"K_EXPORT_PLASMA_PACKAGE_WITH_JSON"
"K_EXPORT_PLASMA_APPLETSCRIPTENGINE"
"K_EXPORT_PLASMA_APPLETSCRIPTENGINE_WITH_JSON"
"K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE"
"K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE_WITH_JSON"
"K_EXPORT_PLASMA_CONTAINMENTACTIONS_WITH_JSON"
"K_EXPORT_PLASMA_DATAENGINE"
"K_EXPORT_PLASMA_DATAENGINE_WITH_JSON"
)
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 ${Plasma_AUTOMOC_MACRO_NAMES})
endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
#add_definitions(-Wno-deprecated)

View File

@ -20,4 +20,10 @@ find_dependency(KF5Package "@KF5_DEP_VERSION@")
find_dependency(KF5Service "@KF5_DEP_VERSION@")
find_dependency(KF5WindowSystem "@KF5_DEP_VERSION@")
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 @Plasma_AUTOMOC_MACRO_NAMES@)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/KF5PlasmaMacros.cmake")