Skip to content

Commit

Permalink
[cmake] Fix Qt6 CMake build system issues on Ubuntu 24.10.
Browse files Browse the repository at this point in the history
- Set QT_NO_CREATE_VERSIONLESS_TARGETS to disable Qt::Core. Otherwise,
  CMake ends up trying to create Qt::Core twice, even when building for
  KF6 only and not KF5+KF6:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreVersionlessTargets.cmake:42 (message):
  Some (but not all) targets in this export set were already defined.

  Targets Defined: Qt::Core

  Targets not yet defined: Qt::CorePrivate

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreConfig.cmake:68 (include)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:174 (find_package)
  cmake/libs/RP_FindQt6andKF6.cmake:34 (FIND_PACKAGE)
  src/kde/kf6/CMakeLists.txt:6 (FIND_QT6_AND_KF6)

- Don't specify the minimum KF6 version, because that's breaking for
  some reason.

-- Could NOT find KF65.248.0 (missing: KF65.248.0_DIR)
-- Could NOT find KF65.248.0: found neither KF65.248.0Config.cmake nor kf65.248.0-config.cmake
CMake Error at /usr/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find KF6 (missing: 5.248.0) (found version "6.6.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/ECM/find-modules/FindKF6.cmake:93 (find_package_handle_standard_args)
  cmake/libs/RP_FindQt6andKF6.cmake:78 (FIND_PACKAGE)
  src/kde/kf6/CMakeLists.txt:6 (FIND_QT6_AND_KF6)
  • Loading branch information
GerbilSoft committed Nov 13, 2024
1 parent b18306d commit cb50765
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmake/libs/RP_FindQt4andKDE4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
MACRO(FIND_QT4_AND_KDE4)
SET(ENV{QT_SELECT} qt4)
SET(QT_DEFAULT_MAJOR_VERSION 4)
SET(QT_NO_CREATE_VERSIONLESS_TARGETS TRUE)

SET(QT4_NO_LINK_QTMAIN 1)
FIND_PACKAGE(Qt4 4.6.0 ${REQUIRE_KDE4} COMPONENTS QtCore QtGui QtDBus)
Expand Down
1 change: 1 addition & 0 deletions cmake/libs/RP_FindQt5andKF5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ MACRO(FIND_QT5_AND_KF5)

SET(ENV{QT_SELECT} qt5)
SET(QT_DEFAULT_MAJOR_VERSION 5)
SET(QT_NO_CREATE_VERSIONLESS_TARGETS TRUE)

# FIXME: Search for Qt5 first instead of ECM?

Expand Down
5 changes: 4 additions & 1 deletion cmake/libs/RP_FindQt6andKF6.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ MACRO(FIND_QT6_AND_KF6)

SET(ENV{QT_SELECT} qt6)
SET(QT_DEFAULT_MAJOR_VERSION 6)
SET(QT_NO_CREATE_VERSIONLESS_TARGETS TRUE)

# FIXME: Search for Qt6 first instead of ECM?
SET(KF6_MIN 5.248.0)
Expand Down Expand Up @@ -73,7 +74,9 @@ MACRO(FIND_QT6_AND_KF6)
SET(QT_PLUGIN_INSTALL_DIR "${KF6_PLUGIN_INSTALL_DIR}")

# Find KF6.
FIND_PACKAGE(KF6 ${REQUIRE_KF6} ${KF6_MIN} COMPONENTS KIO WidgetsAddons FileMetaData Crash)
# FIXME: Specifying the minimum version here breaks on Kubuntu 24.10.
#FIND_PACKAGE(KF6 ${REQUIRE_KF6} ${KF6_MIN} COMPONENTS KIO WidgetsAddons FileMetaData Crash)
FIND_PACKAGE(KF6 ${REQUIRE_KF6} COMPONENTS KIO WidgetsAddons FileMetaData Crash)
IF(NOT KF6KIO_FOUND OR NOT KF6WidgetsAddons_FOUND OR NOT KF6FileMetaData_FOUND OR NOT KF6Crash_FOUND)
# KF6 not found.
SET(BUILD_KF6 OFF CACHE INTERNAL "Build the KDE Frameworks 6 plugin." FORCE)
Expand Down
4 changes: 3 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ rom-properties (2.4-1ppa6~oracular5) oracular; urgency=medium

* Add statx() to syscall whitelist to fix SIGSYS in amiiboc on armhf.

-- David Korth <[email protected]> Tue, 12 Nov 2024 19:57:50 -0500
* Fix Qt6 CMake build system issues

-- David Korth <[email protected]> Tue, 12 Nov 2024 20:38:28 -0500

rom-properties (2.4-1ppa6~oracular4) oracular; urgency=medium

Expand Down

0 comments on commit cb50765

Please sign in to comment.