Skip to content

Commit

Permalink
Use Qt6.1 where binaries moc/uic/rcc have been moved
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Jun 11, 2024
1 parent 46ccb34 commit 6cccfeb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/premake5-qt-ubuntu-gmake2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
qt-version: ['5.15.0', '6.0.4']
qt-version: ['5.15.0', '6.0.4', '6.1.0']

steps:
- name: Checkout
Expand Down
9 changes: 6 additions & 3 deletions projects-qt/project-without-premake-qt/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ if QtRoot == nil or QtRoot == "" then
exit(1)
end

local qt_major_version = _OPTIONS["qt-version"]:sub(1, 1)
local qt_buildtool_path = iif(premake.checkVersion(_OPTIONS["qt-version"], "<6.1.0"), path.join(QtRoot, "bin"), path.join(QtRoot, "lib", "qt" .. qt_major_version))

local function lrelease_command()
buildmessage 'lrelease %{file.relpath} -qm bin/%{file.basename}.qm'
buildoutputs { path.join(LocationDir, "bin", "%{file.basename}.qm") }
Expand All @@ -43,22 +46,22 @@ end
local function moc_command()
buildmessage "moc -o moc_%{file.basename}.cpp %{file.relpath}"
buildoutputs { path.join(LocationDir, "obj", "moc_%{file.basename}.cpp") }
buildcommands { path.join(QtRoot, "bin", "moc") .. " -o %[%{!sln.location}/obj/moc_%{file.basename}.cpp]" .. " %[%{!file.abspath}]" }
buildcommands { path.join(qt_buildtool_path, "moc") .. " -o %[%{!sln.location}/obj/moc_%{file.basename}.cpp]" .. " %[%{!file.abspath}]" }
compilebuildoutputs "on"
end

local function rcc_command()
buildmessage 'rcc -o obj/qrc_%{file.basename}.cpp %{file.relpath}'
--buildinputs { "%{file.relpath}" } -- extra dependencies: content of <file>..</file>
buildoutputs { path.join(LocationDir, "obj", "qrc_%{file.basename}.cpp") }
buildcommands { path.join(QtRoot, "bin", "rcc") .. " -name %{file.basename} -no-compress %[%{!file.abspath}] -o %[%{!sln.location}/obj/qrc_%{file.basename}.cpp]" }
buildcommands { path.join(qt_buildtool_path, "rcc") .. " -name %{file.basename} -no-compress %[%{!file.abspath}] -o %[%{!sln.location}/obj/qrc_%{file.basename}.cpp]" }
compilebuildoutputs "on"
end

local function uic_command()
buildmessage 'uic -o obj/ui_%{file.basename}.h %{file.relpath}'
buildoutputs { path.join(LocationDir, "obj", "ui_%{file.basename}.h") }
buildcommands { path.join(QtRoot, "bin", "uic") .. " -o %[%{!sln.location}/obj/ui_%{file.basename}.h] %[%{!file.abspath}]" }
buildcommands { path.join(qt_buildtool_path, "uic") .. " -o %[%{!sln.location}/obj/ui_%{file.basename}.h] %[%{!file.abspath}]" }
end

rule "uic"
Expand Down
2 changes: 1 addition & 1 deletion submodules/premake-qt
Submodule premake-qt updated 1 files
+9 −3 qt.lua

0 comments on commit 6cccfeb

Please sign in to comment.