Commit 2fa80804 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Ensure build dependency on JSON files using CMAKE_AUTOMOC_DEPEND_FILTERS

Also do needed setup for automoc in installed CMake config file.
parent 4d75045c
Pipeline #17968 passed with stage
in 7 minutes and 33 seconds
......@@ -67,12 +67,25 @@ if(ANDROID)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS AndroidExtras)
endif()
# Replace with ECMSetupQtPluginMacroNames once depending on ECM >= 5.45
# incl. passing same code generated by var into Okular5Config.cmake.in
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()
if(NOT CMAKE_VERSION VERSION_LESS "3.9.0")
# CMake's automoc needs help to find names of plugin metadata files in case Q_PLUGIN_METADATA
# is indirectly used via other C++ preprocessor macros
# 3.9+ lets us provide some filter rule pairs (keyword, regexp) to match the names of such files
# in the plain text of the sources. See AUTOMOC_DEPEND_FILTERS docs for details.
list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
"OKULAR_EXPORT_PLUGIN"
"[\n^][ \t]*OKULAR_EXPORT_PLUGIN[ \t\n]*\\([^,]*,[ \t\n]*\"([^\"]+)\""
)
endif()
set(optionalComponents)
if (ANDROID)
# we want to make sure that generally all components are found
......
......@@ -9,4 +9,24 @@ find_dependency(KF5CoreAddons @KF5_REQUIRED_VERSION@)
find_dependency(KF5Config @KF5_REQUIRED_VERSION@)
find_dependency(KF5XmlGui @KF5_REQUIRED_VERSION@)
####################################################################################
# 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 OKULAR_EXPORT_PLUGIN)
endif()
if(NOT CMAKE_VERSION VERSION_LESS "3.9.0")
# CMake's automoc needs help to find names of plugin metadata files in case Q_PLUGIN_METADATA
# is indirectly used via other C++ preprocessor macros
# 3.9+ lets us provide some filter rule pairs (keyword, regexp) to match the names of such files
# in the plain text of the sources. See AUTOMOC_DEPEND_FILTERS docs for details.
list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
"OKULAR_EXPORT_PLUGIN"
"[\n^][ \t]*OKULAR_EXPORT_PLUGIN[ \t\n]*\\([^,]*,[ \t\n]*\"([^\"]+)\""
)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/Okular5Targets.cmake")
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