Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Improve cmake find_package scanning for KDE/Qt #635

Description

@phmccarty

After extending the list of cmake module mappings recently (#628), find_package scanning has improved significantly.

The scanning can be further improved by scanning for COMPONENTS passed to find_package specifically for the Qt5 and KF5 packages. For those packages, each component indicates a module name, and that name is produced by appending the component name to the package name. For example, find_package(Qt5 ... COMPONENTS Core) should return the modules Qt5 and Qt5Core instead of just Qt5.

More extended examples can be found in this CMakeLists.txt; in particular, scanning these two commands:

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
    Concurrent
    DBus
    PrintSupport
    QuickWidgets
    Widgets
)

find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
    CoreAddons
    Config
    I18n
    Declarative
    KIO
    Kirigami2
    Notifications
    Plasma
    Wayland
    WidgetsAddons
    WindowSystem
)

should produce these modules:

Qt5
Qt5Core
Qt5Concurrent
Qt5DBus
Qt5PrintSupport
Qt5QuickWidgets
Qt5Widgets
KF5
KF5CoreAddons
KF5Config
KF5I18n
KF5Declarative
KF5KIO
KF5Kirigami2
KF5Notifications
KF5Plasma
KF5Wayland
KF5WidgetsAddons
KF5WindowSystem

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request for autospec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions