Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
Show All 17 Lines | |||||
18 | include(KDEInstallDirs) | 18 | include(KDEInstallDirs) | ||
19 | include(KDECMakeSettings) | 19 | include(KDECMakeSettings) | ||
20 | include(CMakePackageConfigHelpers) | 20 | include(CMakePackageConfigHelpers) | ||
21 | include(ECMSetupVersion) | 21 | include(ECMSetupVersion) | ||
22 | include(ECMMarkNonGuiExecutable) | 22 | include(ECMMarkNonGuiExecutable) | ||
23 | include(ECMAddQch) | 23 | include(ECMAddQch) | ||
24 | include(ECMQtDeclareLoggingCategory) | 24 | include(ECMQtDeclareLoggingCategory) | ||
25 | include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) | 25 | include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) | ||
26 | include(ECMSetupQtPluginMacroNames) | ||||
26 | 27 | | |||
27 | option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) | 28 | option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) | ||
28 | add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") | 29 | add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") | ||
29 | 30 | | |||
30 | ecm_setup_version(PROJECT | 31 | ecm_setup_version(PROJECT | ||
31 | VARIABLE_PREFIX PACKAGE | 32 | VARIABLE_PREFIX PACKAGE | ||
32 | VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpackage_version.h" | 33 | VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpackage_version.h" | ||
33 | PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PackageConfigVersion.cmake" | 34 | PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PackageConfigVersion.cmake" | ||
Show All 18 Lines | |||||
52 | 53 | | |||
53 | find_package(KF5DocTools ${KF5_DEP_VERSION}) | 54 | find_package(KF5DocTools ${KF5_DEP_VERSION}) | ||
54 | set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Tools to generate documentation" | 55 | set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Tools to generate documentation" | ||
55 | TYPE OPTIONAL | 56 | TYPE OPTIONAL | ||
56 | ) | 57 | ) | ||
57 | 58 | | |||
58 | ######################################################################### | 59 | ######################################################################### | ||
59 | 60 | | |||
60 | # TODO: create ECM macro for automoc & json things | 61 | ecm_setup_qtplugin_macro_names( | ||
61 | set(KPackage_AUTOMOC_MACRO_NAMES_WITH_JSON_ARG2 "K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON") | 62 | JSON_ARG2 | ||
62 | set(KPackage_AUTOMOC_MACRO_NAMES | 63 | "K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON" | ||
63 | ${KPackage_AUTOMOC_MACRO_NAMES_WITH_JSON_ARG2} | 64 | CONFIG_CODE_VARIABLE | ||
65 | PACKAGE_SETUP_AUTOMOC_VARIABLES | ||||
64 | ) | 66 | ) | ||
65 | if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") | | |||
66 | # CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros. | | |||
67 | # 3.10+ lets us provide more macro names that require automoc. | | |||
68 | list(APPEND CMAKE_AUTOMOC_MACRO_NAMES ${KPackage_AUTOMOC_MACRO_NAMES}) | | |||
69 | endif() | | |||
70 | if(NOT CMAKE_VERSION VERSION_LESS "3.9.0") | | |||
71 | foreach(macro_name ${KPackage_AUTOMOC_MACRO_NAMES_WITH_JSON_ARG2}) | | |||
72 | # tell automoc how to find names of plugin metadata files | | |||
73 | list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS | | |||
74 | "${macro_name}" | | |||
75 | "[\n^][ \t]*${macro_name}[ \t\n]*\\([^,]*,[ \t\n]*\"([^\"]+)\"" | | |||
76 | ) | | |||
77 | endforeach() | | |||
78 | endif() | | |||
79 | 67 | | |||
80 | add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) | 68 | add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) | ||
81 | 69 | | |||
82 | #add_definitions(-Wno-deprecated) | 70 | #add_definitions(-Wno-deprecated) | ||
83 | add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) | 71 | add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) | ||
84 | add_definitions(-DQT_NO_URL_CAST_FROM_STRING) | 72 | add_definitions(-DQT_NO_URL_CAST_FROM_STRING) | ||
85 | 73 | | |||
86 | include(KF5PackageMacros.cmake) | 74 | include(KF5PackageMacros.cmake) | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |