diff options
| author | 2023-07-14 16:04:57 +0200 | |
|---|---|---|
| committer | 2023-07-14 10:04:57 -0400 | |
| commit | 4649cf024839d90b5ac202652367ede62d2dacd4 (patch) | |
| tree | 4e6ded6091dd94a1a00690eaa9278b04cc949ca2 /scripts | |
| parent | 8e4f4c24c0d31e53060bf25415a1e8f3316932f5 (diff) | |
Allow the use of either Qt5 or Qt6 on Linux (#11413)
* Look for MOC in QT_HOME/libexec if not found in QT_HOME/bin
* Use the Qt6* libraries if the Qt version is >= 6
* Switch the include paths for QAction & QActionGroup for Qt >= 6
* Replace the deprecated + operator for keys with |
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/src/osd/modules.lua | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index 6cb47db91a6..7ea3e26b753 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -378,12 +378,19 @@ function qtdebuggerbuild() MOC = "moc" else if _OPTIONS["QT_HOME"]~=nil then - QMAKETST = backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake --version 2>/dev/null") - if (QMAKETST=='') then - print("Qt's Meta Object Compiler (moc) wasn't found!") - os.exit(1) + MOCTST = backtick(_OPTIONS["QT_HOME"] .. "/bin/moc --version 2>/dev/null") + if (MOCTST=='') then + MOCTST = backtick(_OPTIONS["QT_HOME"] .. "/libexec/moc --version 2>/dev/null") + if (MOCTST=='') then + print("Qt's Meta Object Compiler (moc) wasn't found!") + os.exit(1) + else + MOC = _OPTIONS["QT_HOME"] .. "/libexec/moc" + end + else + MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" end - MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" + MOC = _OPTIONS["QT_HOME"] .. "/libexec/moc" else MOCTST = backtick("which moc-qt5 2>/dev/null") if (MOCTST=='') then @@ -494,14 +501,23 @@ function osdmodulestargetconf() } else if _OPTIONS["QT_HOME"]~=nil then + local qt_version = str_to_version(backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_VERSION")) linkoptions { "-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"), } - links { - "Qt5Core", - "Qt5Gui", - "Qt5Widgets", - } + if qt_version < 60000 then + links { + "Qt5Core", + "Qt5Gui", + "Qt5Widgets", + } + else + links { + "Qt6Core", + "Qt6Gui", + "Qt6Widgets", + } + end else local str = backtick(pkgconfigcmd() .. " --libs Qt5Widgets") addlibfromstring(str) |
