Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
Show All 12 Lines | |||||
13 | 13 | | |||
14 | 14 | | |||
15 | include(GenerateExportHeader) | 15 | include(GenerateExportHeader) | ||
16 | include(CMakePackageConfigHelpers) | 16 | include(CMakePackageConfigHelpers) | ||
17 | include(ECMSetupVersion) | 17 | include(ECMSetupVersion) | ||
18 | include(ECMGenerateHeaders) | 18 | include(ECMGenerateHeaders) | ||
19 | include(ECMQtDeclareLoggingCategory) | 19 | include(ECMQtDeclareLoggingCategory) | ||
20 | include(ECMAddQch) | 20 | include(ECMAddQch) | ||
21 | include(ECMSetupQtPluginMacroNames) | ||||
21 | 22 | | |||
22 | include(KDEInstallDirs) | 23 | include(KDEInstallDirs) | ||
23 | include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) | 24 | include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) | ||
24 | include(KDECMakeSettings) | 25 | include(KDECMakeSettings) | ||
25 | 26 | | |||
26 | option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) | 27 | option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) | ||
27 | add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") | 28 | add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") | ||
28 | 29 | | |||
29 | set(REQUIRED_QT_VERSION 5.7.0) | 30 | set(REQUIRED_QT_VERSION 5.7.0) | ||
30 | find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core) | 31 | find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core) | ||
31 | 32 | | |||
32 | # TODO: create ECM macro for automoc & json things | 33 | ecm_setup_qtplugin_macro_names( | ||
33 | set(KCoreAddons_AUTOMOC_MACRO_NAMES "K_PLUGIN_FACTORY_WITH_JSON" "K_PLUGIN_FACTORY" "K_PLUGIN_CLASS_WITH_JSON") | 34 | JSON_NONE | ||
34 | if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") | 35 | "K_PLUGIN_FACTORY" | ||
35 | # CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros. | 36 | JSON_ARG2 | ||
36 | # 3.10+ lets us provide more macro names that require automoc. | 37 | "K_PLUGIN_FACTORY_WITH_JSON" | ||
37 | list(APPEND CMAKE_AUTOMOC_MACRO_NAMES ${KCoreAddons_AUTOMOC_MACRO_NAMES}) | 38 | "K_PLUGIN_CLASS_WITH_JSON" | ||
38 | endif() | 39 | CONFIG_CODE_VARIABLE | ||
39 | set(KCoreAddons_AUTOMOC_MACRO_NAMES_WITH_JSON_ARG2 "K_PLUGIN_FACTORY_WITH_JSON" "K_PLUGIN_CLASS_WITH_JSON") | 40 | PACKAGE_SETUP_AUTOMOC_VARIABLES | ||
40 | if(NOT CMAKE_VERSION VERSION_LESS "3.9.0") | | |||
41 | # CMake's automoc needs help to find names of plugin metadata files in case Q_PLUGIN_METADATA | | |||
42 | # is indirectly used via other C++ preprocessor macros | | |||
43 | # 3.9+ lets us provide some filter rule pairs (keyword, regexp) to match the names of such files | | |||
44 | # in the plain text of the sources. See AUTOMOC_DEPEND_FILTERS docs for details. | | |||
45 | foreach(macro_name ${KCoreAddons_AUTOMOC_MACRO_NAMES_WITH_JSON_ARG2}) | | |||
46 | list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS | | |||
47 | "${macro_name}" | | |||
48 | "[\n^][ \t]*${macro_name}[ \t\n]*\\([^,]*,[ \t\n]*\"([^\"]+)\"" | | |||
49 | ) | 41 | ) | ||
50 | endforeach() | | |||
51 | endif() | | |||
52 | | ||||
53 | 42 | | |||
54 | find_package(Threads) | 43 | find_package(Threads) | ||
55 | 44 | | |||
56 | # Configure checks for kdirwatch | 45 | # Configure checks for kdirwatch | ||
57 | find_package(FAM) | 46 | find_package(FAM) | ||
58 | 47 | | |||
59 | set_package_properties(FAM PROPERTIES | 48 | set_package_properties(FAM PROPERTIES | ||
60 | PURPOSE "Provides file alteration notification facilities using a separate service. FAM provides additional support for NFS.") | 49 | PURPOSE "Provides file alteration notification facilities using a separate service. FAM provides additional support for NFS.") | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |