Fix several parameters after Qt6 migration.

This commit is contained in:
Andre Rummler
2026-08-10 19:47:34 +02:00
parent c5d714089f
commit af87d28e33
3 changed files with 61 additions and 46 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ jobs:
-DQt5_DIR=/ucrt64/lib/cmake/Qt5 \ -DQt5_DIR=/ucrt64/lib/cmake/Qt5 \
-DQT_VERSION_MAJOR=5 \ -DQT_VERSION_MAJOR=5 \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=ON \ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6=ON \
-DBUILD_TESTING=OFF \ -DPACKAGE_TESTS=OFF \
-DCMAKE_POLICY_DEFAULT_CMP0077=NEW \ -DCMAKE_POLICY_DEFAULT_CMP0077=NEW \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_CXX_FLAGS="-DQET_EXPORT_PROJECT_DB" \ -DCMAKE_CXX_FLAGS="-DQET_EXPORT_PROJECT_DB" \
+11 -1
View File
@@ -76,7 +76,7 @@ find_package(
# and only provide the implicit Qt6::GuiPrivate target created alongside # and only provide the implicit Qt6::GuiPrivate target created alongside
# Qt6::Gui. Try the component quietly, then verify the target below so a # Qt6::Gui. Try the component quietly, then verify the target below so a
# missing private-headers package fails here instead of at compile time. # missing private-headers package fails here instead of at compile time.
# Qt5 has no such component its GuiPrivate target always exists once Gui is found. # Qt5 has no such component as its GuiPrivate target always exists once Gui is found.
if(QT_VERSION_MAJOR GREATER_EQUAL 6) if(QT_VERSION_MAJOR GREATER_EQUAL 6)
find_package(Qt6 QUIET COMPONENTS GuiPrivate) find_package(Qt6 QUIET COMPONENTS GuiPrivate)
endif() endif()
@@ -91,6 +91,16 @@ endif()
find_package(SQLite3 REQUIRED) find_package(SQLite3 REQUIRED)
# CMake < 4.3 only creates the SQLite::SQLite3 target (no SQLite3::SQLite3
# alias yet), while CMake >= 4.3's bundled FindSQLite3 creates SQLite3::SQLite3
# and deprecates the old name. Add the missing alias ourselves so we can use
# the modern target name everywhere regardless of the CMake version in use
# (this project must keep building on CMake versions below 4.3, e.g. on most
# current Linux distros).
if(NOT TARGET SQLite3::SQLite3 AND TARGET SQLite::SQLite3)
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
endif()
set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui) set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui)
if(QT_VERSION_MAJOR EQUAL 6) if(QT_VERSION_MAJOR EQUAL 6)
+49 -44
View File
@@ -20,58 +20,63 @@ message(" - fetch_kdeaddons")
if(BUILD_WITH_KF) if(BUILD_WITH_KF)
Include(FetchContent) Include(FetchContent)
option(BUILD_KF "Build KF5 libraries, use system ones otherwise" YES) option(BUILD_KF "Build KF libraries, use system ones otherwise" YES)
if(BUILD_KF) if(BUILD_KF)
if(KF_MAJOR_VERSION EQUAL 5) if(KF_MAJOR_VERSION EQUAL 5)
if(NOT DEFINED KF_GIT_TAG) if(NOT DEFINED KF_GIT_TAG)
#https://qelectrotech.org/forum/viewtopic.php?pid=13924#p13924 #https://qelectrotech.org/forum/viewtopic.php?pid=13924#p13924
set(KF_GIT_TAG v5.77.0) set(KF_GIT_TAG v5.77.0)
endif()
else()
if(NOT DEFINED KF_GIT_TAG)
# this is a more or less random version, taken as an conservative approach
set(KF_GIT_TAG v6.10.0)
endif()
endif() endif()
else() // using a function in order to limit the scope of the variables
if(NOT DEFINED KF_GIT_TAG) // with CMake >=3.25 we could use a block()
set(KF_GIT_TAG v6.10.0) function(qet_make_kf_available)
endif() # Fix stop the run autotests of kcoreaddons
endif() # see
# https://invent.kde.org/frameworks/kcoreaddons/-/blob/master/CMakeLists.txt#L98
# issue:
# CMake Error at /usr/share/ECM/modules/ECMAddTests.cmake:89 (add_executable):
# Cannot find source file:
# see
# https://qelectrotech.org/forum/viewtopic.php?pid=13929#p13929
set(KDE_SKIP_TEST_SETTINGS ON)
set(BUILD_TESTING OFF)
# Fix stop the run autotests of kcoreaddons # QElectroTech is a plain QtWidgets application with no QML anywhere in
# see # it; these disable optional features of the fetched KF modules that
# https://invent.kde.org/frameworks/kcoreaddons/-/blob/master/CMakeLists.txt#L98 # would otherwise pull in extra Qt6 components (e.g. Qt6Qml) we don't
# issue: # have and don't need.
# CMake Error at /usr/share/ECM/modules/ECMAddTests.cmake:89 (add_executable): set(BUILD_DESIGNERPLUGIN OFF)
# Cannot find source file: set(KCOREADDONS_USE_QML OFF)
# see set(BUILD_QCH OFF)
# https://qelectrotech.org/forum/viewtopic.php?pid=13929#p13929 set(BUILD_SHARED_LIBS OFF)
set(KDE_SKIP_TEST_SETTINGS "TRUE")
set(BUILD_TESTING "0")
# QElectroTech is a plain QtWidgets application with no QML anywhere in FetchContent_Declare(
# it; these disable optional features of the fetched KF modules that ecm
# would otherwise pull in extra Qt6 components (e.g. Qt6Qml) we don't GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git
# have and don't need. GIT_TAG ${KF_GIT_TAG})
set(BUILD_DESIGNERPLUGIN OFF) FetchContent_MakeAvailable(ecm)
set(KCOREADDONS_USE_QML OFF)
set(BUILD_QCH OFF)
set(BUILD_SHARED_LIBS OFF)
FetchContent_Declare( FetchContent_Declare(
ecm kcoreaddons
GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
GIT_TAG ${KF_GIT_TAG}) GIT_TAG ${KF_GIT_TAG})
FetchContent_MakeAvailable(ecm) FetchContent_MakeAvailable(kcoreaddons)
FetchContent_Declare( FetchContent_Declare(
kcoreaddons kwidgetsaddons
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
GIT_TAG ${KF_GIT_TAG}) GIT_TAG ${KF_GIT_TAG})
FetchContent_MakeAvailable(kcoreaddons) FetchContent_MakeAvailable(kwidgetsaddons)
endfunction()
FetchContent_Declare( qet_make_kf_available()
kwidgetsaddons
GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
GIT_TAG ${KF_GIT_TAG})
FetchContent_MakeAvailable(kwidgetsaddons)
else() else()
find_package(KF${KF_MAJOR_VERSION}CoreAddons REQUIRED) find_package(KF${KF_MAJOR_VERSION}CoreAddons REQUIRED)
find_package(KF${KF_MAJOR_VERSION}WidgetsAddons REQUIRED) find_package(KF${KF_MAJOR_VERSION}WidgetsAddons REQUIRED)