From 1627c29ac597a2a2ccbd99ec73c9eae94e0db96c Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 20 Oct 2022 13:09:52 +0200 Subject: [PATCH] drop qt4 support --- .appveyor.yml | 1 - .github/workflows/fixme-windows.txt | 1 - .github/workflows/osx.yml | 1 - .github/workflows/ubuntu.yml | 1 - CHANGELOG.md | 9 ++ CMakeLists.txt | 1 - INSTALL | 13 +-- cmake/compiler_gnu_gcc.cmake | 9 -- cmake/external_libraries.cmake | 147 ++++++++++++---------------- cmake/qrc_embedding.cmake | 7 +- debian/rules | 3 +- docs/installation/source/options.md | 7 -- testing/CMakeLists.txt | 36 ++++--- 13 files changed, 92 insertions(+), 144 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index b59ef80..bf52d4a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -22,7 +22,6 @@ before_build: - cmd: > cmake .. -G "Visual Studio 12 2013" -T v120_xp - -DUseQtFive=ON -DUsePrerenderedPDF=ON -DBoostStaticLink=ON -DWindowsStaticLink=OFF diff --git a/.github/workflows/fixme-windows.txt b/.github/workflows/fixme-windows.txt index f17fd14..37d154a 100644 --- a/.github/workflows/fixme-windows.txt +++ b/.github/workflows/fixme-windows.txt @@ -28,7 +28,6 @@ before_build: - cmd: > cmake .. -G "Visual Studio 12 2013" -T v120_xp - -DUseQtFive=ON -DUsePrerenderedPDF=ON -DBoostStaticLink=ON -DWindowsStaticLink=OFF diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index bc8a3bb..e7854fa 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -26,7 +26,6 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON -DUsePrerenderedPDF=ON -DCodeCoverage=ON - -DUseQtFive=ON -DCMAKE_BUILD_TYPE=${{matrix.buildtype}} . - run: cmake --build build/ diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index b3e6bfb..560eee5 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -31,7 +31,6 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON -DUsePrerenderedPDF=ON -DCodeCoverage=ON - -DUseQtFive=ON -DCMAKE_BUILD_TYPE=${{matrix.buildtype}} . - run: cmake --build build/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 7936af7..7414745 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ If you're intrested in the specific source-level changes between versions, or non user-relevant changes (like build system or packaging related), please inspect the output of commands like `git diff -w v1.11..v1.12` directly. +v1.15.2 - UNRELEASED +-------------------- + +This is a maintenance release, not introducing any new functionality, +but restoring compatibility with Qt 5.15 LTS. + +Building with Qt4 is no longer supported. If you really need Qt4 +support, please get in touch. + v1.15.1 - 2016-09-13 -------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index ce37ea2..6ba8dfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,6 @@ set(CMAKE_AUTORCC OFF) set(CMAKE_INCLUDE_CURRENT_DIR OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -option(UseQtFive "Build with Qt5 and libpoppler-qt5" ON) option(UpdateTranslations "Do you want to update the .ts files (WARNING: running make clean will delete them!)" OFF) option(BuildTests "Build unit tests (this requires pdflatex or internet access and DownloadTestPDFs=ON)" ON) option(RunDualScreenTests "Also run tests that require two screens to be connected" ON) diff --git a/INSTALL b/INSTALL index f9e34ab..c268cad 100644 --- a/INSTALL +++ b/INSTALL @@ -22,8 +22,8 @@ Installation from source (generic cmake) dspdfviewer requires the following build-time dependencies: * cmake * boost - * qt4 - * poppler-qt4 + * qt5 + * poppler-qt5 From inside the source directory, execute the following steps: @@ -37,12 +37,3 @@ Note that there is no make uninstall, so please redirect the make install step through your system's package management utility. The "cmake" step will respect --prefix= parameters, and "make install" will respect DESTDIR. - - - -Compiling against qt5 and poppler-qt5 -------------------------------------- -There is now experimental support for compiling against qt5/libpoppler-qt5. - -To try it out, substitute the "cmake" step above against - cmake -DUseQtFive=ON .. diff --git a/cmake/compiler_gnu_gcc.cmake b/cmake/compiler_gnu_gcc.cmake index 20d614c..5b2fb0a 100644 --- a/cmake/compiler_gnu_gcc.cmake +++ b/cmake/compiler_gnu_gcc.cmake @@ -32,15 +32,6 @@ add_definitions( # Turn all warnings into errors add_definitions(-Werror -pedantic-errors) -# These warnings produce false positives on some older qt4 libraries -# (this failed debian s390x compilation), therefore tune them back -# to warning when building against qt4. - -if( NOT UseQtFive ) - add_definitions(-Wno-error=old-style-cast) - add_definitions(-Wno-error=effc++) -endif() - if(CodeCoverage) message(STATUS "Adding gcov as test coverage helper") add_definitions(-fprofile-arcs -ftest-coverage -O0) diff --git a/cmake/external_libraries.cmake b/cmake/external_libraries.cmake index cacfbcc..2f81fa2 100644 --- a/cmake/external_libraries.cmake +++ b/cmake/external_libraries.cmake @@ -28,97 +28,74 @@ else() endif() -### Qt -if(UseQtFive) - # Qt5 - message(STATUS "Using Qt5 and libpoppler-qt5") - if(MSVC AND WindowsStaticLink) - # If linking statically, - # Try to find Qt in /qt/static/qtbase - # or plain /qt/static - set(CMAKE_PREFIX_PATH - "/Qt/static/qtbase;/Qt/static;/Qt/static/qttools;${CMAKE_PREFIX_PATH}") - endif() - find_package(Qt5Core 5.1.1 REQUIRED) - # On lower versions, QTBUG-32100 prevents compilation at least on clang - # https://bugreports.qt.io/browse/QTBUG-32100 - find_package(Qt5Gui REQUIRED) - find_package(Qt5Widgets REQUIRED) - find_package(Qt5LinguistTools REQUIRED) - find_package(Qt5Xml REQUIRED) - message(STATUS "Found Qt5 at ${Qt5Core_DIR}") +# Qt5 +message(STATUS "Using Qt5 and libpoppler-qt5") +if(MSVC AND WindowsStaticLink) + # If linking statically, + # Try to find Qt in /qt/static/qtbase + # or plain /qt/static + set(CMAKE_PREFIX_PATH + "/Qt/static/qtbase;/Qt/static;/Qt/static/qttools;${CMAKE_PREFIX_PATH}") +endif() +find_package(Qt5Core 5.1.1 REQUIRED) +# On lower versions, QTBUG-32100 prevents compilation at least on clang +# https://bugreports.qt.io/browse/QTBUG-32100 +find_package(Qt5Gui REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5LinguistTools REQUIRED) +find_package(Qt5Xml REQUIRED) +message(STATUS "Found Qt5 at ${Qt5Core_DIR}") - if(MSVC) - if (WindowsStaticLink) - set(POPPLER_LIBRARIES - ${WINDOWS_PRECOMPILED_STATIC_LIBRARIES} - ) - set(POPPLER_INCLUDE_DIRS - "C:/dspdf/poppler/poppler/include/poppler/qt5" - ) - else() # MSVC, but not statically linking - set(POPPLER_LIBRARIES - ${WINDOWS_PRECOMPILED_DYNAMIC_LIBRARIES} - ) - set(POPPLER_INCLUDE_DIRS - "C:/dspdf/popplerDyn/poppler/include/poppler/qt5" - ) - endif() - else() - # Non-MSVC Platforms: - # Find poppler using pkg-config - pkg_search_module(POPPLER REQUIRED poppler-qt5) +if(MSVC) + if (WindowsStaticLink) + set(POPPLER_LIBRARIES + ${WINDOWS_PRECOMPILED_STATIC_LIBRARIES} + ) + set(POPPLER_INCLUDE_DIRS + "C:/dspdf/poppler/poppler/include/poppler/qt5" + ) + else() # MSVC, but not statically linking + set(POPPLER_LIBRARIES + ${WINDOWS_PRECOMPILED_DYNAMIC_LIBRARIES} + ) + set(POPPLER_INCLUDE_DIRS + "C:/dspdf/popplerDyn/poppler/include/poppler/qt5" + ) endif() +else() + # Non-MSVC Platforms: + # Find poppler using pkg-config + pkg_search_module(POPPLER REQUIRED poppler-qt5) +endif() - # add their link flags - list(APPEND LIST_LIBRARIES - ${Qt5Core_LIBRARIES} - ${Qt5Gui_LIBRARIES} - ${Qt5Widgets_LIBRARIES} - ${Qt5LinguistTools_LIBRARIES} - ${Qt5Xml_LIBRARIES} - ) +# add their link flags +list(APPEND LIST_LIBRARIES + ${Qt5Core_LIBRARIES} + ${Qt5Gui_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5LinguistTools_LIBRARIES} + ${Qt5Xml_LIBRARIES} +) - # add their include directories - list(APPEND LIST_INCLUDE_DIRS - ${Qt5Core_INCLUDE_DIRS} - ${Qt5Gui_INCLUDE_DIRS} - ${Qt5Widgets_INCLUDE_DIRS} - ${Qt5LinguistTools_INCLUDE_DIRS} - ${Qt5Xml_INCLUDE_DIRS} - ) +# add their include directories +list(APPEND LIST_INCLUDE_DIRS + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${Qt5Widgets_INCLUDE_DIRS} + ${Qt5LinguistTools_INCLUDE_DIRS} + ${Qt5Xml_INCLUDE_DIRS} +) - # Set conditional compilation to Qt5 mode - add_definitions(-DPOPPLER_QT5) - qt5_wrap_ui(dspdfviewer_UIS_H ${UIFILES}) - if( UpdateTranslations ) - qt5_create_translation(TRANSLATIONS - ${libdspdfviewer_SRCS} ${dspdfviewer_SRCS} ${UIFILES} ${TRANSLATIONFILES} - OPTIONS -no-obsolete - ) - else() - qt5_add_translation(TRANSLATIONS ${TRANSLATIONFILES}) - endif() +# Set conditional compilation to Qt5 mode +add_definitions(-DPOPPLER_QT5) +qt5_wrap_ui(dspdfviewer_UIS_H ${UIFILES}) +if( UpdateTranslations ) + qt5_create_translation(TRANSLATIONS + ${libdspdfviewer_SRCS} ${dspdfviewer_SRCS} ${UIFILES} ${TRANSLATIONFILES} + OPTIONS -no-obsolete + ) else() - #qt4 - message(STATUS "Using Qt4 and libpoppler-qt4") - message(WARNING "Qt4 support is deprecated and will be removed in the next version. " - "Please build dspdfviewer using Qt5. " - "If that does not work correctly on your platform, please file a bug!") - find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui) - pkg_search_module(POPPLER REQUIRED poppler-qt4) - - list(APPEND LIST_INCLUDE_DIRS ${QT_INCLUDES}) - list(APPEND LIST_LIBRARIES Qt4::QtGui) - qt4_wrap_ui(dspdfviewer_UIS_H ${UIFILES}) - if( UpdateTranslations ) - qt4_create_translation(TRANSLATIONS - ${libdspdfviewer_SRCS} ${dspdfviewer_SRCS} ${UIFILES} ${TRANSLATIONFILES} - OPTIONS -no-obsolete - ) - else() - qt4_add_translation(TRANSLATIONS ${TRANSLATIONFILES}) - endif() + qt5_add_translation(TRANSLATIONS ${TRANSLATIONFILES}) endif() # include/link poppler diff --git a/cmake/qrc_embedding.cmake b/cmake/qrc_embedding.cmake index 40ef5af..a2e4942 100644 --- a/cmake/qrc_embedding.cmake +++ b/cmake/qrc_embedding.cmake @@ -13,12 +13,7 @@ foreach(qrc IN LISTS QRCFILES) set(TMP_OUTFILENAME "${CMAKE_CURRENT_BINARY_DIR}/${qrc}.cxx") - if(UseQtFive) - set(RCCCOMPILER ${Qt5Core_RCC_EXECUTABLE}) - else() - set(RCCCOMPILER ${QT_RCC_EXECUTABLE}) - endif() - + set(RCCCOMPILER ${Qt5Core_RCC_EXECUTABLE}) add_custom_command( OUTPUT ${TMP_OUTFILENAME} diff --git a/debian/rules b/debian/rules index 086bbf1..45d4470 100755 --- a/debian/rules +++ b/debian/rules @@ -14,8 +14,7 @@ include /usr/share/dpkg/buildflags.mk override_dh_auto_configure: dh_auto_configure -- \ - -DDSPDFVIEWER_VERSION=$(shell dpkg-parsechangelog --show-field Version) \ - -DUseQtFive=ON + -DDSPDFVIEWER_VERSION=$(shell dpkg-parsechangelog --show-field Version) %: dh $@ --parallel diff --git a/docs/installation/source/options.md b/docs/installation/source/options.md index 67b4a2a..7677fb2 100644 --- a/docs/installation/source/options.md +++ b/docs/installation/source/options.md @@ -36,13 +36,6 @@ The following `cmake` options manipulate the compilation and dependency list: to include a dist-specific version. * By default, this is auto-detected using `git describe`, with a hardcoded fallback version number (such as, when not building from a git clone). -* `UseQtFive` boolean, default ON - * If this is OFF, `dspdfviewer` will be built against `Qt4` and the - `poppler-qt4` bindings, instead of the Qt5 version. - * If this options is disabled, dspdfviewer depends on Qt4 and libpoppler-qt4, - and no longer depends on Qt5 or libpoppler-qt5. - * The Qt4 support will get dropped eventually. Please use the Qt5 - version and report bugs if you experience regressions compared to Qt4. * `UpdateTranslations` boolean, default OFF * If you want to work on the translation, you can activate this flag to make `cmake` regenerate the `.ts` files. diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 977cfff..10ebcec 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -118,27 +118,25 @@ set_tests_properties( ) # Only build and run the swap screen test on Qt5 -if(UseQtFive) - add_executable(testswapscreen - testswapscreen.cc - testswapscreen-main.cc +add_executable(testswapscreen + testswapscreen.cc + testswapscreen-main.cc +) +target_link_libraries(testswapscreen + testhelp +) + +if(RunDualScreenTests) + add_test(NAME testswapscreen + COMMAND testswapscreen + --prerender-prev=0 + --prerender-next=0 + images.pdf ) - target_link_libraries(testswapscreen - testhelp + set_tests_properties(testswapscreen + PROPERTIES + SKIP_RETURN_CODE 77 ) - - if(RunDualScreenTests) - add_test(NAME testswapscreen - COMMAND testswapscreen - --prerender-prev=0 - --prerender-next=0 - images.pdf - ) - set_tests_properties(testswapscreen - PROPERTIES - SKIP_RETURN_CODE 77 - ) - endif() endif() -- 2.47.3