Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Detect presence of QScroller filter patch in CMake

Carsten Hartenfels56560d90e672
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f990b4d50c..daff95309c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -766,6 +766,7 @@ QWindowsWindowFunctions::setHasBorderInFullScreenDefault(true);
endif (WIN32)
+
CHECK_CXX_SOURCE_COMPILES("
#include <QCoreApplication>
int main(int argc, char *argv[]) {
@@ -784,6 +785,16 @@ QCoreApplication::setKritaAttribute(KRITA_QATTRIBUTE_ANDROID_IGNORE_HISTORIC_TAB
KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
)
+CHECK_CXX_SOURCE_COMPILES("
+#include <QScroller>
+#ifndef KRITA_QSCROLLER_PATCH
+#error \"QScroller filter patch not present\"
+#endif
+int main(int argc, char *argv[]) {}
+"
+KRITA_QT_HAS_QSCROLLER_FILTER
+)
+
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
diff --git a/config-qt-patches-present.h.cmake b/config-qt-patches-present.h.cmake
index da2bad51f2..241d47a8c2 100644
--- a/config-qt-patches-present.h.cmake
+++ b/config-qt-patches-present.h.cmake
@@ -3,3 +3,4 @@
#cmakedefine01 KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
#cmakedefine01 KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
#cmakedefine01 KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
+#cmakedefine01 KRITA_QT_HAS_QSCROLLER_FILTER