If we have Qt5 and Qt6 versions installed at the same time on build machine, the library will be build with Qt5
It may be a problem if your project forced Qt6 version, since ABI will be different
Since we have two entries to find (Qt6 and Qt5), there will be two search cycles
First iteration will set QT_VERSION_MAJOR to 6
Second iteration will set QT_VERSION_MAJOR to 5
As result, the library will always be build with Qt5 instead of Qt6
Solution:
Maybe we can add a flag, which will allow users to use selected Qt version? For example, it may be like this:
option(USE_QT6 "Build with Qt6 (Enabled by default)" ON)
So as library user I can just build with Qt5 if I want to and use default build with Qt6
P.S. Submitted PR, let me know what do you think about it
If we have Qt5 and Qt6 versions installed at the same time on build machine, the library will be build with Qt5 It may be a problem if your project forced Qt6 version, since ABI will be different
CMakeLists.txt contains the following:
This will work as described:
QT_VERSION_MAJOR
to 6QT_VERSION_MAJOR
to 5 As result, the library will always be build with Qt5 instead of Qt6Solution: Maybe we can add a flag, which will allow users to use selected Qt version? For example, it may be like this:
option(USE_QT6 "Build with Qt6 (Enabled by default)" ON)
So as library user I can just build with Qt5 if I want to and use default build with Qt6
P.S. Submitted PR, let me know what do you think about it