Skip to content

Commit

Permalink
move floor from Qt 5.15 to 6.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Apr 26, 2024
1 parent c320b21 commit ec18f4d
Show file tree
Hide file tree
Showing 28 changed files with 2,205 additions and 1,953 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codacy-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
include:
- IMAGE: 'jammy'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/ci_run_tidy.sh'
container:
image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_${{ matrix.IMAGE }}
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,12 @@ jobs:
fail-fast: false
matrix:
include:
- IMAGE: '35'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '37'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '37'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
- IMAGE: '38'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '38'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
- IMAGE: '39'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '39'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
- IMAGE: '40'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '40'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
container:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
include:
- QT_VERSION: '5.15.2'
- QT_VERSION: '6.2.4'
XCODE_VERSION: '13.4.1'
GENERATOR: 'Ninja'
RELEASE: false
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
# focal has Qt 5.12, end of standard support 4/2025, end of life 4/2030.
#- IMAGE: 'focal'
# SCRIPT: './tools/build_and_test_cmake.sh'
- IMAGE: 'jammy'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5'
SCRIPT: './tools/build_and_test_cmake.sh'
- IMAGE: 'jammy'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/build_and_test_cmake.sh'
Expand All @@ -32,7 +29,7 @@ jobs:
SCRIPT: './tools/build_and_test_cmake.sh'
TOOLS: 'clang'
- IMAGE: 'jammy'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/build_extra_tests.sh'
container:
image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_${{ matrix.IMAGE }}
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ jobs:
fail-fast: false
matrix:
include:
- QT_VERSION: '5.15.2'
ARCH: 'amd64'
HOST_ARCH: 'amd64'
COMPILER: 'msvc2019_64'
METHOD: 'aqt'
GENERATOR: 'Visual Studio 16 2019'
RELEASE: false
os: windows-2019
- QT_VERSION: '5.15.2'
- QT_VERSION: '6.2.4'
ARCH: 'amd64'
HOST_ARCH: 'amd64'
COMPILER: 'msvc2019_64'
Expand All @@ -36,7 +28,7 @@ jobs:
GENERATOR: 'Visual Studio 16 2019'
RELEASE: false
os: windows-2019
- QT_VERSION: '5.15.2'
- QT_VERSION: '6.2.4'
ARCH: 'x86'
HOST_ARCH: 'amd64'
COMPILER: 'msvc2019'
Expand Down
30 changes: 11 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@ set(CMAKE_AUTORCC ON)
add_executable(gpsbabel)

# Find the QtCore library
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core)
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15)
message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.")
find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED)
find_package(Qt6 COMPONENTS Core REQUIRED)
list(APPEND QT_LIBRARIES Qt6::Core)
if(${Qt6Core_VERSION} VERSION_LESS 6.2)
message(FATAL_ERROR "Qt version ${Qt6Core_VERSION} found, but version 6.2 or newer is required.")
else()
message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}")
endif()
if(${QT_VERSION_MAJOR} EQUAL "6")
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core5Compat)
message(STATUS "Using Qt6 version ${Qt6Core_VERSION}")
endif()
find_package(Qt6 COMPONENTS Core5Compat REQUIRED)
list(APPEND QT_LIBRARIES Qt6::Core5Compat)

option(GPSBABEL_ENABLE_PCH "enable precompiled headers." ON)
if (GPSBABEL_ENABLE_PCH)
Expand Down Expand Up @@ -174,6 +172,7 @@ set(SUPPORT
rgbcolors.cc
route.cc
session.cc
src/core/codecdevice.cc
src/core/logging.cc
src/core/nvector.cc
src/core/textstream.cc
Expand All @@ -187,9 +186,6 @@ set(SUPPORT
waypt.cc
xmlgeneric.cc
)
if(${QT_VERSION_MAJOR} EQUAL "6")
set(SUPPORT ${SUPPORT} src/core/codecdevice.cc)
endif()

# HEADERS
set(HEADERS
Expand Down Expand Up @@ -267,6 +263,7 @@ set(HEADERS
jeeps/gpsusbcommon.h
jeeps/gpsusbint.h
jeeps/gpsutil.h
src/core/codecdevice.h
src/core/datetime.h
src/core/file.h
src/core/logging.h
Expand All @@ -277,9 +274,6 @@ set(HEADERS
src/core/xmlstreamwriter.h
src/core/xmltag.h
)
if(${QT_VERSION_MAJOR} EQUAL "6")
set(HEADERS ${HEADERS} src/core/codecdevice.h)
endif()

string(REPLACE .cc .h FILTER_HEADERS "${FILTERS}")
set(HEADERS ${HEADERS} ${FILTER_HEADERS})
Expand All @@ -292,9 +286,7 @@ endif()

if(WIN32)
target_compile_definitions(gpsbabel PRIVATE __WIN32__)
if(${QT_VERSION_MAJOR} EQUAL "6")
qt_disable_unicode_defines(gpsbabel)
endif()
qt_disable_unicode_defines(gpsbabel)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
target_compile_definitions(gpsbabel PRIVATE _DEBUG)
endif()
Expand Down
3 changes: 1 addition & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,5 @@ On non-macOS unix builds by default we now compile in the gpsbabel generated
translation files, i.e. gpsbabelfe_*.qm, gpsbabel_*.qm, as well as
gmapbase.html. When compiled in these files do not need to be distributed.
These are used by the GUI. Additional translation files from Qt will also be
used if they are found. They may be in a package such as qttranslations5-l10n
or qt5-qttranslations.
used if they are found. They may be in a package such as qt6-translations-l10n.

4 changes: 0 additions & 4 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1022,10 +1022,6 @@ int color_to_bbggrr(const char* cname);
constexpr double unknown_alt = -99999999.0;
constexpr int unknown_color = -1;

#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
using qhash_result_t = uint;
#else
using qhash_result_t = size_t;
#endif

#endif // DEFS_H_INCLUDED_
15 changes: 0 additions & 15 deletions gdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <QString> // for QString
#include <QStringView> // for QStringView
#include <QVector> // for QVector
#include <QtGlobal> // for QT_VERSION, QT_VERSION_CHECK

#include "defs.h" // for arglist_t, Waypoint, route_head, ARGTYPE_BOOL, ARGTYPE_INT, ARG_NOMINMAX, bounds, FF_CAP_RW_ALL, ff_cap, ff_type, ff_type_file
#include "format.h" // for Format
Expand Down Expand Up @@ -76,21 +75,7 @@ class GdbFormat : public Format

friend qhash_result_t qHash(const WptNamePosnKey &c, qhash_result_t seed = 0) noexcept
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
return qHashMulti(seed, c.shortname.toUpper(), c.lat, c.lon);
#else
/*
* As noted in above refeference
* QtPrivate::QHashCombine is private API, but does not require any special buildsystem magic;
* it’s in <qhashfunctions.h>, a public header.
*/
QtPrivate::QHashCombine hash;

seed = hash(seed, c.shortname.toUpper());
seed = hash(seed, c.lat);
seed = hash(seed, c.lon);
return seed;
#endif
}

QString shortname;
Expand Down
32 changes: 16 additions & 16 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ if(NOT UNIX OR APPLE)
endif()

# Find the QtCore library
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network SerialPort Widgets Xml REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml)
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15)
message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.")
find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED)
find_package(Qt6 COMPONENTS Core Gui Network SerialPort Widgets Xml REQUIRED)
list(APPEND QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Network Qt6::SerialPort Qt6::Widgets Qt6::Xml)
if(${Qt6Core_VERSION} VERSION_LESS 6.2)
message(FATAL_ERROR "Qt version ${Qt6Core_VERSION} found, but version 6.2 or newer is required.")
else()
message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}")
message(STATUS "Using Qt6 version ${Qt6Core_VERSION}")
endif()

option(GPSBABEL_MAPPREVIEW "enable map preview." ON)
if (GPSBABEL_MAPPREVIEW)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WebEngineWidgets WebChannel REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::WebEngineWidgets Qt${QT_VERSION_MAJOR}::WebChannel)
find_package(Qt6 COMPONENTS WebEngineWidgets WebChannel REQUIRED)
list(APPEND QT_LIBRARIES Qt6::WebEngineWidgets Qt6::WebChannel)
else()
target_compile_definitions(gpsbabelfe PRIVATE DISABLE_MAPPREVIEW)
endif()
Expand Down Expand Up @@ -173,9 +173,9 @@ message(STATUS "Libs are: \"${LnkLibs}\"")
get_target_property(IncDirs gpsbabelfe INCLUDE_DIRECTORIES)
message(STATUS "Include Directores are: \"${IncDirs}\"")

find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS LinguistTools)
if (NOT Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
message(WARNING "Qt${QT_VERSION_MAJOR}LinguistTools not found, gpsbabelfe translations cannot be updated or released, and application cannot be packaged.")
find_package(Qt6 QUIET COMPONENTS LinguistTools)
if (NOT Qt6LinguistTools_FOUND)
message(WARNING "Qt6LinguistTools not found, gpsbabelfe translations cannot be updated or released, and application cannot be packaged.")
else()
# FIXME: translations updated and released in source directory (and under version control).
list(APPEND TRANSLATIONS gpsbabelfe_de.ts)
Expand All @@ -186,27 +186,27 @@ else()
list(APPEND TRANSLATIONS gpsbabelfe_ru.ts)

add_custom_target(gpsbabelfe_lupdate
COMMAND Qt${QT_VERSION_MAJOR}::lupdate ${SOURCES} ${FORMS} -ts ${TRANSLATIONS}
COMMAND Qt6::lupdate ${SOURCES} ${FORMS} -ts ${TRANSLATIONS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
USES_TERMINAL)
add_custom_target(gpsbabelfe_lrelease
COMMAND Qt${QT_VERSION_MAJOR}::lrelease ${TRANSLATIONS}
COMMAND Qt6::lrelease ${TRANSLATIONS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS gpsbabelfe_lupdate
VERBATIM
USES_TERMINAL)

if(APPLE)
get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
add_custom_target(package_app
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $<TARGET_BUNDLE_DIR:gpsbabelfe> -q ${_qmake_executable} -g $<TARGET_FILE:gpsbabel> -s ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_BUNDLE_DIR:gpsbabelfe>/../GPSBabelFE.dmg ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS gpsbabelfe gpsbabel gpsbabelfe_lrelease coretool_lrelease
VERBATIM
USES_TERMINAL)
elseif(UNIX)
get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
add_custom_target(package_app
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $<TARGET_FILE_DIR:gpsbabelfe> -q ${_qmake_executable} -g $<TARGET_FILE:gpsbabel> -s ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS gpsbabelfe gpsbabel gpsbabelfe_lrelease coretool_lrelease
Expand All @@ -220,7 +220,7 @@ else()
endif()

# in 5.12.12 cmake doesn't know about windeployqt, look in directory that has qmake.
get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(WINDEPLOYQT NAMES windeployqt PATHS "${_qt_bin_dir}" NO_DEFAULT_PATH)
if (WINDEPLOYQT STREQUAL "WINDEPLOYQT-NOTFOUND")
Expand Down
10 changes: 10 additions & 0 deletions gui/coretool/core_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ QT_TRANSLATE_NOOP("core","Source for name field in .dbf")
QT_TRANSLATE_NOOP("core","Source for URL field in .dbf")
QT_TRANSLATE_NOOP("core","ESRI shapefile")
QT_TRANSLATE_NOOP("core","(integer sec or 'auto') Barograph to GPS time diff")
QT_TRANSLATE_NOOP("core","Engine Noise (ENL; default=1)")
QT_TRANSLATE_NOOP("core","True Airspeed (TAS; default=1)")
QT_TRANSLATE_NOOP("core","Total Energy Vario (VAT; default=1)")
QT_TRANSLATE_NOOP("core","Outside Air Temperature (OAT; default=1)")
QT_TRANSLATE_NOOP("core","True Track (TRT; default=0)")
QT_TRANSLATE_NOOP("core","Ground Speed (GSP; default=1)")
QT_TRANSLATE_NOOP("core","Fix Accuracy (FXA; default=1)")
QT_TRANSLATE_NOOP("core","# Of Sats (SIU; default=0)")
QT_TRANSLATE_NOOP("core","Z Acceleration (ACZ; default=1)")
QT_TRANSLATE_NOOP("core","G Force? (GFO; default=0)")
QT_TRANSLATE_NOOP("core","FAI/IGC Flight Recorder Data Format")
QT_TRANSLATE_NOOP("core","Read all points even if latitude or longitude is missing")
QT_TRANSLATE_NOOP("core","Attempt to recovery data from corrupt file")
Expand Down
Loading

0 comments on commit ec18f4d

Please sign in to comment.