Skip to content
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

Let cmake automatically recognize Qt5 and Qt6 to build #42

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

Conversation

graycatya
Copy link

I feel that tweaking the Qt build in cmake in this way automatically recognizes Qt5 and Qt6 versions.

@robertosfield
Copy link
Collaborator

Is this actually preferred by Qt users? I'm expecting folks to be targeting Qt5 and Qt6 in their applications so would want that version with the vsgQt build.

Perhaps there may be some value in vsgQt5 and vsgQt6 library names and building both and have uses decide which is more appropriate for their application.

@graycatya graycatya closed this Jan 4, 2025
@graycatya graycatya reopened this Jan 4, 2025
@graycatya
Copy link
Author

graycatya commented Jan 4, 2025

Is this actually preferred by Qt users? I'm expecting folks to be targeting Qt5 and Qt6 in their applications so would want that version with the vsgQt build.

Perhaps there may be some value in vsgQt5 and vsgQt6 library names and building both and have uses decide which is more appropriate for their application.

Your idea is right, all for the user to get vsgQt and let the user decide the qt version.

I am a long-term user of qt development. When using qt5 or qt6 Toolchain, configure qt5 or qt6 in cmake. Generally, the development environment needs to configure the current qt toolchain path not to have both qt5 and qt6. This can refer to the Qt Creator cmake project CMAKE_PREFIX_PATH configuration is generally automatically configured by the IDE, and find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED), CMake will try to find either Qt6 or Qt5 and make sure that at least one of these versions contains a Widgets component. If found, CMake will set the relevant variables and targets for use in your project. Obtain QT_VERSION_MAJOR corresponding to qt version 5 or 6. In the qt development environment, users only need to adjust the Qt Toolchain version without adjusting the vsgQt cmake source file.

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