]> sigrok.org Git - pulseview.git/commitdiff
Drop support for Qt4.
authorUwe Hermann <redacted>
Tue, 28 Mar 2017 20:26:02 +0000 (22:26 +0200)
committerUwe Hermann <redacted>
Tue, 28 Mar 2017 23:20:18 +0000 (01:20 +0200)
We now require Qt5 for PulseView. Qt5 has been out since 2012 or so and
is available pretty much everywhere now.

We're successfully using Qt5 on Linux, Windows, *BSD, Mac OS X, and Android.

Dropping Qt4 support simplifies the build system quite a bit, reduces the
number of test scenarios we have to consider etc. etc.

CMakeLists.txt
INSTALL
test/CMakeLists.txt

index d2697fae7c2c6d21a670166a39666283f49a933b..0d9b455f2316548c71507a746fe95c4e241601e9 100644 (file)
@@ -35,7 +35,6 @@ option(ENABLE_SIGNALS "Build with UNIX signals" TRUE)
 option(ENABLE_DECODE "Build with libsigrokdecode" TRUE)
 option(ENABLE_TESTS "Enable unit tests" TRUE)
 option(STATIC_PKGDEPS_LIBS "Statically link to (pkg-config) libraries" FALSE)
-option(FORCE_QT4 "Force use of Qt4 even if Qt5 is available" FALSE)
 
 if(WIN32)
        # On Windows/MinGW we need to statically link to libraries.
@@ -69,30 +68,21 @@ endif()
 find_package(PkgConfig)
 pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS})
 
-if(FORCE_QT4)
-       set(Qt5Core_FOUND FALSE)
-else()
-       find_package(Qt5Core QUIET)
+find_package(Qt5Core REQUIRED)
+find_package(Qt5Widgets REQUIRED)
+find_package(Qt5Gui REQUIRED)
+find_package(Qt5Svg REQUIRED)
+
 if(WIN32)
        # MXE workaround: Use pkg-config to find Qt5 libs.
        # https://github.com/mxe/mxe/issues/1642
        pkg_check_modules(QT5ALL REQUIRED Qt5Widgets Qt5Gui Qt5Svg)
 endif()
-endif()
 
-if(Qt5Core_FOUND)
-       message("-- Using Qt5")
-       find_package(Qt5Widgets REQUIRED)
-       find_package(Qt5Gui REQUIRED)
-       find_package(Qt5Svg REQUIRED)
-       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
-       set(QT_INCLUDE_DIRS ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
-       set(QT_LIBRARIES Qt5::Gui Qt5::Widgets Qt5::Svg)
-       add_definitions(${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS})
-else()
-       find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 qmake-mac)
-       find_package(Qt4 REQUIRED QtCore QtGui QtSvg)
-endif()
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+set(QT_INCLUDE_DIRS ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
+set(QT_LIBRARIES Qt5::Gui Qt5::Widgets Qt5::Svg)
+add_definitions(${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS})
 
 set(BOOSTCOMPS filesystem serialization system)
 if(ENABLE_TESTS)
@@ -104,7 +94,6 @@ find_package(Boost 1.55 COMPONENTS ${BOOSTCOMPS} REQUIRED)
 # This will set ${CMAKE_THREAD_LIBS_INIT} to the correct, OS-specific value.
 find_package(Threads REQUIRED)
 
-
 # Check for explicit link against libatomic
 #
 # Depending on the toolchain, linking a program using atomic functions may need
@@ -377,17 +366,8 @@ if(ANDROID)
        )
 endif()
 
-if(Qt5Core_FOUND)
-       qt5_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS})
-       qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
-else()
-       # Workaround for QTBUG-22829: -DBOOST_NEXT_PRIOR_HPP_INCLUDED.
-       # https://bugreports.qt.io/browse/QTBUG-22829
-       qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}
-               OPTIONS -DBOOST_NEXT_PRIOR_HPP_INCLUDED)
-       qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
-       include(${QT_USE_FILE})
-endif()
+qt5_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS})
+qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
 
 #===============================================================================
 #= Global Definitions
diff --git a/INSTALL b/INSTALL
index e17cb252e08061c4383290626d7309afb7e687ea..075b18cedab5aa09a2ecf575409202c9f5418905 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -15,9 +15,8 @@ Requirements
  - cmake >= 2.8.6
  - libglib >= 2.28.0
  - glibmm-2.4 (>= 2.28.0)
- - Qt4 >= 4.5 or Qt5 (including the following components):
-    - Qt4: QtCore, QtGui, QtSvg
-    - Qt5: Qt5Core, Qt5Gui, Qt5Widgets, Qt5Svg
+ - Qt5 (including the following components):
+    - Qt5Core, Qt5Gui, Qt5Widgets, Qt5Svg
  - libboost >= 1.55 (including the following libs):
     - libboost-system
     - libboost-filesystem
index 05b5cb4b0be21fad00c83135f93419e3b8d8597a..3a1a3d29a4806db2ada4f28e29bf4de955889137 100644 (file)
@@ -176,15 +176,7 @@ if(ENABLE_DECODE)
        )
 endif()
 
-if(Qt5Core_FOUND)
-       qt5_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS})
-else()
-       # Workaround for QTBUG-22829: -DBOOST_NEXT_PRIOR_HPP_INCLUDED.
-       # https://bugreports.qt.io/browse/QTBUG-22829
-       qt4_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS}
-               OPTIONS -DBOOST_NEXT_PRIOR_HPP_INCLUDED)
-       include(${QT_USE_FILE})
-endif()
+qt5_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS})
 
 # On MinGW we need to use static linking.
 if(NOT WIN32)