Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
61 | set(HAVE_X11 ${X11_FOUND}) | 61 | set(HAVE_X11 ${X11_FOUND}) | ||
62 | set(HAVE_XTEST ${X11_XTest_FOUND}) | 62 | set(HAVE_XTEST ${X11_XTest_FOUND}) | ||
63 | if(X11_FOUND) | 63 | if(X11_FOUND) | ||
64 | find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | 64 | find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | ||
65 | endif() | 65 | endif() | ||
66 | if(APPLE) | 66 | if(APPLE) | ||
67 | find_package(Qt5MacExtras ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | 67 | find_package(Qt5MacExtras ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | ||
68 | endif() | 68 | endif() | ||
69 | if (ANDROID) | ||||
70 | find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED AndroidExtras) | ||||
71 | find_package(Gradle REQUIRED) | ||||
72 | endif() | ||||
73 | if (WIN32) | ||||
74 | find_package(LibSnoreToast REQUIRED) | ||||
75 | set_package_properties(LibSnoreToast PROPERTIES TYPE REQUIRED | ||||
76 | PURPOSE "for the Windows Toast Notifications" | ||||
77 | DESCRIPTION "A command line application, capable of creating | ||||
78 | Windows Toast notifications on Windows (>=)8 " | ||||
79 | ) | ||||
80 | find_package(Qt5Network REQUIRED) | ||||
81 | endif() | ||||
69 | 82 | | |||
70 | find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED) | 83 | find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED) | ||
71 | find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) | 84 | find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) | ||
72 | find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) | 85 | find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) | ||
73 | find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) | 86 | find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) | ||
74 | 87 | | |||
88 | if (NOT WIN32) | ||||
89 | find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus) | ||||
75 | find_package(Canberra) | 90 | find_package(Canberra) | ||
76 | set_package_properties(Canberra PROPERTIES DESCRIPTION "Library for generating event sounds" | 91 | set_package_properties(Canberra PROPERTIES DESCRIPTION "Library for generating event sounds" | ||
77 | PURPOSE "Needed to build audio notification support" | 92 | PURPOSE "Needed to build audio notification support" | ||
78 | URL "http://0pointer.de/lennart/projects/libcanberra" | 93 | URL "http://0pointer.de/lennart/projects/libcanberra" | ||
79 | TYPE OPTIONAL) | 94 | TYPE OPTIONAL) | ||
80 | if (Canberra_FOUND) | 95 | if (Canberra_FOUND) | ||
81 | add_definitions(-DHAVE_CANBERRA) | 96 | add_definitions(-DHAVE_CANBERRA) | ||
82 | elseif(NOT ANDROID) | 97 | else() | ||
83 | # This is REQUIRED since you cannot tell CMake "either one of those two optional ones are required" | 98 | # This is REQUIRED since you cannot tell CMake "either one of those two optional ones are required" | ||
84 | find_package(Phonon4Qt5 4.6.60 NO_MODULE REQUIRED) | 99 | find_package(Phonon4Qt5 4.6.60 NO_MODULE REQUIRED) | ||
85 | set_package_properties(Phonon4Qt5 PROPERTIES | 100 | set_package_properties(Phonon4Qt5 PROPERTIES | ||
86 | DESCRIPTION "Qt-based audio library" | 101 | DESCRIPTION "Qt-based audio library" | ||
87 | PURPOSE "Needed to build audio notification support when Canberra isn't available") | 102 | PURPOSE "Needed to build audio notification support when Canberra isn't available") | ||
88 | add_definitions(-DHAVE_PHONON4QT5) | 103 | add_definitions(-DHAVE_PHONON4QT5) | ||
89 | endif() | 104 | endif() | ||
sredman: Move this `if(Android)` block up to where the other *Extras are, lines 63-68 (then remove the… | |||||
105 | endif() | ||||
90 | 106 | | |||
91 | remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) | 107 | remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) | ||
92 | #add_definitions(-DQT_NO_FOREACH) | 108 | #add_definitions(-DQT_NO_FOREACH) | ||
93 | if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") | 109 | if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") | ||
94 | ecm_install_po_files_as_qm(po) | 110 | ecm_install_po_files_as_qm(po) | ||
95 | endif() | 111 | endif() | ||
96 | if (NOT APPLE) # QtMac::setBadgeLabelText is deprecated | 112 | if (NOT APPLE) # QtMac::setBadgeLabelText is deprecated | ||
97 | add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00) | 113 | add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00) | ||
98 | endif() | 114 | endif() | ||
99 | add_subdirectory(src) | 115 | add_subdirectory(src) | ||
100 | if (BUILD_TESTING) | 116 | if (BUILD_TESTING) | ||
101 | add_subdirectory(tests) | 117 | add_subdirectory(tests) | ||
102 | add_subdirectory(autotests) | 118 | add_subdirectory(autotests) | ||
103 | endif() | 119 | endif() | ||
104 | 120 | | |||
105 | # create a Config.cmake and a ConfigVersion.cmake file and install them | 121 | # create a Config.cmake and a ConfigVersion.cmake file and install them | ||
106 | set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Notifications") | 122 | set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Notifications") | ||
107 | 123 | | |||
108 | if (BUILD_QCH) | 124 | if (BUILD_QCH) | ||
109 | ecm_install_qch_export( | 125 | ecm_install_qch_export( | ||
110 | TARGETS KF5Notifications_QCH | 126 | TARGETS KF5Notifications_QCH | ||
Logically this else is pretty separate from the if that it is connected to. Could you change it to if(NOT WIN32) to make it easier to read? sredman: Logically this `else` is pretty separate from the `if` that it is connected to. Could you… | |||||
111 | FILE KF5NotificationsQchTargets.cmake | 127 | FILE KF5NotificationsQchTargets.cmake | ||
112 | DESTINATION "${CMAKECONFIG_INSTALL_DIR}" | 128 | DESTINATION "${CMAKECONFIG_INSTALL_DIR}" | ||
113 | COMPONENT Devel | 129 | COMPONENT Devel | ||
114 | ) | 130 | ) | ||
115 | set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5NotificationsQchTargets.cmake\")") | 131 | set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5NotificationsQchTargets.cmake\")") | ||
116 | endif() | 132 | endif() | ||
117 | 133 | | |||
118 | include(CMakePackageConfigHelpers) | 134 | include(CMakePackageConfigHelpers) | ||
119 | 135 | | |||
120 | set(HAVE_DBUS FALSE) | 136 | set(HAVE_DBUS FALSE) | ||
121 | if (TARGET Qt5::DBus) | 137 | if (TARGET Qt5::DBus) | ||
138 | find_package(dbusmenu-qt5 CONFIG) | ||||
139 | set_package_properties(dbusmenu-qt5 PROPERTIES DESCRIPTION "DBusMenuQt" | ||||
140 | URL "https://launchpad.net/libdbusmenu-qt" TYPE OPTIONAL | ||||
141 | PURPOSE "Support for notification area menus via the DBusMenu protocol") | ||||
142 | | ||||
122 | set(HAVE_DBUS TRUE) | 143 | set(HAVE_DBUS TRUE) | ||
123 | endif() | 144 | endif() | ||
124 | configure_package_config_file( | 145 | configure_package_config_file( | ||
125 | "${CMAKE_CURRENT_SOURCE_DIR}/KF5NotificationsConfig.cmake.in" | 146 | "${CMAKE_CURRENT_SOURCE_DIR}/KF5NotificationsConfig.cmake.in" | ||
126 | "${CMAKE_CURRENT_BINARY_DIR}/KF5NotificationsConfig.cmake" | 147 | "${CMAKE_CURRENT_BINARY_DIR}/KF5NotificationsConfig.cmake" | ||
127 | PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR | 148 | PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR | ||
128 | INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} | 149 | INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} | ||
129 | ) | 150 | ) | ||
Show All 18 Lines |
Move this if(Android) block up to where the other *Extras are, lines 63-68 (then remove the connected else and then fix the indenting)