Update to Qt6

- New baseline minimum platform is Ubuntu 22.04
    - Qt6 requires at least 6.2
        - some deprecations may be flagged on later versions (e.g. 6.8)
    - CMake requires at least 3.22
- Include build-tests.yml github action to validate builds on mulitple platforms
- QtTest is no longer optional since it easily comes along for the ride with Qt
- Replaced QStringRef in model::SubstitutionField with simple ParserState class
- Removed deprecations up to Qt 6.2
This commit is contained in:
Jaye Evins
2025-05-06 18:26:53 -04:00
parent f683896706
commit f15c21a01d
42 changed files with 478 additions and 226 deletions
+7 -18
View File
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.9)
cmake_minimum_required (VERSION 3.22)
###############################################################################
# gLabels Label Designer Project
@@ -111,12 +111,7 @@ if (MINGW)
set (CMAKE_PREFIX_PATH ${MINGW_BASE_DIR} )
endif ()
find_package (Qt5Core 5.15 REQUIRED)
find_package (Qt5Widgets 5.15 REQUIRED)
find_package (Qt5PrintSupport 5.15 REQUIRED)
find_package (Qt5Xml 5.15 REQUIRED)
find_package (Qt5Svg 5.15 REQUIRED)
find_package (Qt5LinguistTools)
find_package (Qt6 6.2 REQUIRED COMPONENTS Core Gui Widgets PrintSupport Xml Svg LinguistTools Test)
if (WIN32)
# Locate Qt directories
@@ -131,8 +126,6 @@ find_package (ZLIB 1.2 QUIET)
find_package (GnuBarcode 0.98 QUIET)
find_package (LibQrencode 3.4 QUIET)
find_package (LibZint 2.6 EXACT QUIET)
# Unit testing support
find_package (Qt5Test 5.6 QUIET)
#=======================================
@@ -143,7 +136,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
# Uncomment to compile everything with aggressively pedantic options
# (not recommended -- only for testing -- also not portable)
#
#add_compile_options("-Wall" "-Werror" "-Wpedantic")
#add_compile_options("-Wall" "-Wextra" "-Wpedantic" "-Wno-unused-parameter" "-Werror")
# Uncomment to always compile with debug symbols
add_compile_options("-g")
@@ -153,7 +146,7 @@ endif ()
#=======================================
# Unit Testing
#=======================================
if (Qt5Test_FOUND)
if (Qt6Test_FOUND)
enable_testing ()
endif ()
@@ -177,11 +170,13 @@ add_subdirectory (data)
message (STATUS "")
message (STATUS "Project name ............ " ${CMAKE_PROJECT_NAME})
message (STATUS "Project version ......... " ${LONG_VERSION_STRING})
message (STATUS "Host system ............. " ${CMAKE_HOST_SYSTEM} " " ${CMAKE_HOST_SYSTEM_PROCESSOR})
message (STATUS "Target system ........... " ${CMAKE_SYSTEM} " " ${CMAKE_SYSTEM_PROCESSOR})
message (STATUS "Installation prefix ..... " ${CMAKE_INSTALL_PREFIX})
message (STATUS "Source code location .... " ${glabels_SOURCE_DIR})
message (STATUS "CMake version ........... " ${CMAKE_VERSION})
message (STATUS "C++ Compiler ............ " ${CMAKE_CXX_COMPILER_ID} " " ${CMAKE_CXX_COMPILER} " " ${CMAKE_CXX_COMPILER_VERSION})
message (STATUS "Qt version .............. " ${Qt5Core_VERSION})
message (STATUS "Qt version .............. " ${Qt6Core_VERSION})
if (ZLIB_FOUND)
message (STATUS "zlib (optional).......... " ${ZLIB_VERSION_STRING})
@@ -207,12 +202,6 @@ else (LIBZINT_FOUND)
message (STATUS "libzint (optional)....... No.")
endif (LIBZINT_FOUND)
if (Qt5Test_FOUND)
message (STATUS "QtTest (optional)........ " ${Qt5Test_VERSION})
else (Qt5Test_FOUND)
message (STATUS "QtTest (optional)........ No.")
endif (Qt5Test_FOUND)
if (MSVC)
message (STATUS "MSVC Qt location ........ " ${QT_BASE_DIR})
endif (MSVC)