Skip to content

qt: Add Qt:: namespace alias for every module. #27421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cadmiy
Copy link

@cadmiy cadmiy commented May 14, 2025

Summary

Changes to recipe: qt/5.x.x, qt/6.x.x

Motivation

Qt6 supports Qt:: namespace for cmake targets. This namespace has also been backported to Qt5.
However, the namespace is not available in conan recipes. The problem arose when we were trying to switch from Qt5 to Qt6.

Details

Inside Qt5{module}Config.cmake files for every module there is an alias for Qt5/Qt6 namespace to Qt. For example, for Qt5CoreConfig.cmake it looks like this:

# Add a versionless target, for compatibility with Qt6.
if(NOT "${QT_NO_CREATE_VERSIONLESS_TARGETS}" AND TARGET Qt5::Core AND NOT TARGET Qt::Core)
    add_library(Qt::Core INTERFACE IMPORTED)
    set_target_properties(Qt::Core PROPERTIES
        INTERFACE_LINK_LIBRARIES "Qt5::Core"
    )
endif()

However, this alias is not available in conan recipes. The suggested changes fix that.


@CLAassistant
Copy link

CLAassistant commented May 14, 2025

CLA assistant check
All committers have signed the CLA.

valgur pushed a commit to valgur/conan-center-index that referenced this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants