Skip to content

Commit

Permalink
Simplify Qt version handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Jun 11, 2024
1 parent 093c10f commit 39420cb
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 90 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/premake5-qt-mac-xcode4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand Down Expand Up @@ -70,14 +66,14 @@ jobs:
- name: test projects default(clang)
run: |
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-major-version }}
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-version }}
- name: test projects gcc
run: |
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-major-version }} --cc=gcc
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-version }} --cc=gcc
- name: test projects clang
run: |
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-major-version }} --cc=clang
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-version }} --cc=clang
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-ubuntu-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand Down Expand Up @@ -81,4 +77,4 @@ jobs:
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
xvfb-run -a python3 ./test_projects.py premake5 projects-qt cmake --qt-version=${{ matrix.qt-major-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt cmake --qt-version=${{ matrix.qt-version }}
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-ubuntu-codeblocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand Down Expand Up @@ -92,4 +88,4 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
#--qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codeblocks --qt-version=${{ matrix.qt-major-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codeblocks --qt-version=${{ matrix.qt-version }}
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-ubuntu-codelite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand Down Expand Up @@ -85,5 +81,5 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
# --qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codelite --qt-version=${{ matrix.qt-major-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codelite --qt-version=${{ matrix.qt-version }}
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-ubuntu-gmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand Down Expand Up @@ -75,4 +71,4 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
#--qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake --qt-version=${{ matrix.qt-major-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake --qt-version=${{ matrix.qt-version }}
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-ubuntu-gmake2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand Down Expand Up @@ -75,4 +71,4 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
#--qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake2 --qt-version=${{ matrix.qt-major-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake2 --qt-version=${{ matrix.qt-version }}
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-ubuntu-ninja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

runs-on: ubuntu-latest

Expand Down Expand Up @@ -90,4 +86,4 @@ jobs:
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
xvfb-run -a python3 ./test_projects.py premake5 projects-qt ninja --qt-version=${{ matrix.qt-major-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt ninja --qt-version=${{ matrix.qt-version }}
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-ubuntu-qmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand Down Expand Up @@ -79,4 +75,4 @@ jobs:
- name: test projects default(gcc)
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as Qt widget requires displays :/
xvfb-run -a python3 ./test_projects.py premake5 projects-qt qmake --qt-version=${{ matrix.qt-major-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt qmake --qt-version=${{ matrix.qt-version }}
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-windows-msvc-2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand All @@ -64,5 +60,5 @@ jobs:

- name: test projects
run: |
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects-qt vs2019 --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-major-version }}
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects-qt vs2019 --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-version }}
shell: bash
8 changes: 2 additions & 6 deletions .github/workflows/premake5-qt-windows-msvc-2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-version: ['5.15.0', '6.0.4']

steps:
- name: Checkout
Expand All @@ -63,5 +59,5 @@ jobs:

- name: test projects
run: |
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects-qt vs2022 --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-major-version }}
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects-qt vs2022 --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-version }}
shell: bash
7 changes: 3 additions & 4 deletions projects-qt/project-01-simple/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ newoption {
newoption {
trigger = "qt-version",
value = "version",
allowed = { {"Qt5", "Qt5 (Default)"}, {"Qt6", "Qt6"} },
description = "Version of Qt",
default = "Qt5"
default = "5.15.0"
}

if (_ACTION == nil) then
Expand All @@ -37,13 +36,13 @@ workspace "Project"
objdir(path.join(LocationDir, "obj")) -- premake adds $(configName)/$(AppName)
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))

qt.enable()
qt.enable(qt.enable(string.sub(_OPTIONS["qt-version"], 1, 1)))
qtversion(_OPTIONS["qt-version"])
qtuseexternalinclude ( true )

if (QtRoot ~= nil and QtRoot ~= "") then
qtpath(QtRoot)
end
qtprefix(_OPTIONS["qt-version"])

filter "configurations:Debug"
targetsuffix "d"
Expand Down
7 changes: 3 additions & 4 deletions projects-qt/project-moc/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ newoption {
newoption {
trigger = "qt-version",
value = "version",
allowed = { {"Qt5", "Qt5 (Default)"}, {"Qt6", "Qt6"} },
description = "Version of Qt",
default = "Qt5"
default = "5.15.0"
}

if (_ACTION == nil) then
Expand All @@ -38,7 +37,8 @@ workspace "Project"
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))

if _ACTION ~= "qmake" then
qt.enable()
qt.enable(string.sub(_OPTIONS["qt-version"], 1, 1))
qtversion(_OPTIONS["qt-version"])
end

qtuseexternalinclude ( true )
Expand All @@ -53,7 +53,6 @@ end
if (QtRoot ~= nil and QtRoot ~= "") then
qtpath(QtRoot)
end
qtprefix ( _OPTIONS["qt-version"] )

filter "configurations:Debug"
targetsuffix "d"
Expand Down
7 changes: 3 additions & 4 deletions projects-qt/project-qt/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ newoption {
newoption {
trigger = "qt-version",
value = "version",
allowed = { {"Qt5", "Qt5 (Default)"}, {"Qt6", "Qt6"} },
description = "Version of Qt",
default = "Qt5"
default = "5.15.0"
}

if (_ACTION == nil) then
Expand All @@ -38,7 +37,8 @@ workspace "Project"
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))

if _ACTION ~= "qmake" then
qt.enable()
qt.enable(string.sub(_OPTIONS["qt-version"], 1, 1))
qtversion(_OPTIONS["qt-version"])
end
qtuseexternalinclude ( true )

Expand All @@ -52,7 +52,6 @@ end
if (QtRoot ~= nil and QtRoot ~= "") then
qtpath(QtRoot)
end
qtprefix ( _OPTIONS["qt-version"] )

qtlreleaseargs { "-nounfinished" }

Expand Down
7 changes: 3 additions & 4 deletions projects-qt/project-rcc/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ newoption {
newoption {
trigger = "qt-version",
value = "version",
allowed = { {"Qt5", "Qt5 (Default)"}, {"Qt6", "Qt6"} },
description = "Version of Qt",
default = "Qt5"
default = "5.15.0"
}

if (_ACTION == nil) then
Expand All @@ -38,7 +37,8 @@ workspace "Project"
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))

if _ACTION ~= "qmake" then
qt.enable()
qt.enable(string.sub(_OPTIONS["qt-version"], 1, 1))
qtversion(_OPTIONS["qt-version"])
end
qtuseexternalinclude ( true )

Expand All @@ -52,7 +52,6 @@ end
if (QtRoot ~= nil and QtRoot ~= "") then
qtpath(QtRoot)
end
qtprefix ( _OPTIONS["qt-version"] )

filter "configurations:Debug"
targetsuffix "d"
Expand Down
7 changes: 3 additions & 4 deletions projects-qt/project-translation/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ newoption {
newoption {
trigger = "qt-version",
value = "version",
allowed = { {"Qt5", "Qt5 (Default)"}, {"Qt6", "Qt6"} },
description = "Version of Qt",
default = "Qt5"
default = "5.15.0"
}

if (_ACTION == nil) then
Expand All @@ -38,14 +37,14 @@ workspace "Project"
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))

if _ACTION ~= "qmake" then
qt.enable()
qt.enable(string.sub(_OPTIONS["qt-version"], 1, 1))
qtversion(_OPTIONS["qt-version"])
end
qtuseexternalinclude ( true )

if (QtRoot ~= nil and QtRoot ~= "") then
qtpath(QtRoot)
end
qtprefix ( _OPTIONS["qt-version"] )

qtlreleaseargs { "-nounfinished" }

Expand Down
7 changes: 3 additions & 4 deletions projects-qt/project-uic/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ newoption {
newoption {
trigger = "qt-version",
value = "version",
allowed = { {"Qt5", "Qt5 (Default)"}, {"Qt6", "Qt6"} },
description = "Version of Qt",
default = "Qt5"
default = "5.15.0"
}

if (_ACTION == nil) then
Expand All @@ -37,7 +36,8 @@ workspace "Project"
objdir(path.join(LocationDir, "obj")) -- premake adds $(configName)/$(AppName)
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))

qt.enable()
qt.enable(string.sub(_OPTIONS["qt-version"], 1, 1))
qtversion(_OPTIONS["qt-version"])
qtuseexternalinclude ( true )

-- codeblocks doesn't support custom build different by configuration
Expand All @@ -50,7 +50,6 @@ workspace "Project"
if (QtRoot ~= nil and QtRoot ~= "") then
qtpath(QtRoot)
end
qtprefix ( _OPTIONS["qt-version"] )

filter "configurations:Debug"
targetsuffix "d"
Expand Down
Loading

0 comments on commit 39420cb

Please sign in to comment.