Skip to content

Commit 0380367

Browse files
OmniTroidclaude
andcommitted
Drop QT_ROOT= CLI override; derive it from QT_PATH
QT_PATH= already says "use exactly this Qt install" — QT_ROOT was redundant once that existed. The script still uses QT_ROOT internally (find_cmake / find_mingw look under ${QT_ROOT}/Tools), but it's now derived from QT_PATH (two dirname levels up) instead of being a second flag the caller has to remember. CI invocations collapse to a single line. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9b70bc3 commit 0380367

2 files changed

Lines changed: 12 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ jobs:
4242

4343
- name: Configure and build
4444
shell: bash
45-
run: |
46-
QT_ROOT="$(cd "$QT_ROOT_DIR/../.." && pwd)"
47-
./configure.sh QT_ROOT="$QT_ROOT" QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
45+
run: ./configure.sh QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
4846

4947
- name: Upload Artifact
5048
uses: actions/upload-artifact@master
@@ -76,9 +74,7 @@ jobs:
7674
run: sudo apt-get update && sudo apt-get install -y ninja-build patchelf libxcb-cursor0
7775

7876
- name: Configure and build
79-
run: |
80-
QT_ROOT="$(cd "$QT_ROOT_DIR/../.." && pwd)"
81-
./configure.sh QT_ROOT="$QT_ROOT" QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
77+
run: ./configure.sh QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
8278

8379
- name: Stage APNG plugin for AppImage
8480
run: |

configure.sh

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ print_help() {
3535
echo "Options:"
3636
echo " -h, --help: Print this help message"
3737
echo " clean: Remove all files from lib, bin and tmp"
38-
echo " QT_ROOT=path: Specify the root path to where Qt is installed (eg. /c/Qt/)"
39-
echo " QT_PATH=path: Specify the exact Qt install to use, bypassing auto-detection (eg. /c/Qt/6.5.3/mingw_64)"
38+
echo " QT_PATH=path: Use this Qt toolchain directly, skipping auto-detection (eg. /c/Qt/6.5.3/mingw_64)"
4039
echo " BUILD_TYPE=Debug|Release: CMake build type (default: Debug)"
4140
}
4241

@@ -378,46 +377,37 @@ configure() {
378377
fi
379378

380379
# Parse KEY=VALUE overrides
381-
QT_ROOT=""
382380
QT_PATH=""
383381
while [ "$#" -gt 0 ]; do
384382
case "$1" in
385-
QT_ROOT=*) QT_ROOT="${1#*=}" ;;
386383
QT_PATH=*) QT_PATH="${1#*=}" ;;
387384
BUILD_TYPE=*) BUILD_CONFIG="${1#*=}" ;;
388385
*) echo "Unknown argument: $1"; print_help; exit 1 ;;
389386
esac
390387
shift
391388
done
392389

393-
# Resolve QT_ROOT (auto-detect if not overridden). Still needed even when
394-
# QT_PATH is given explicitly — find_cmake / find_mingw / find_ninja use
395-
# ${QT_ROOT}/Tools.
396-
if [ -z "$QT_ROOT" ]; then
397-
QT_ROOT=$(find_qt)
398-
if [ -z "$QT_ROOT" ]; then
399-
echo "Qt not found. Aborting."; exit 1;
400-
fi
401-
fi
402-
if [ ! -d "$QT_ROOT" ]; then
403-
echo "$QT_ROOT is not a directory. Aborting."
404-
exit 1
405-
fi
406-
echo "Using Qt root: $QT_ROOT"
407-
408-
# Resolve QT_PATH: explicit override wins, otherwise auto-detect.
390+
# Resolve QT_PATH: explicit override wins, otherwise auto-detect under $HOME/Qt.
391+
# QT_ROOT is the parent of the version dir, derived from QT_PATH. Tools/ lives
392+
# under it (find_cmake / find_mingw / find_ninja look there).
409393
if [ -n "$QT_PATH" ]; then
410394
if [ ! -d "$QT_PATH" ]; then
411395
echo "$QT_PATH is not a directory. Aborting."
412396
exit 1
413397
fi
398+
QT_ROOT="$(cd "$QT_PATH/../.." && pwd)"
414399
else
400+
QT_ROOT=$(find_qt)
401+
if [ -z "$QT_ROOT" ]; then
402+
echo "Qt not found. Aborting."; exit 1;
403+
fi
415404
QT_PATH=$(find_qtpath)
416405
if [ -z "$QT_PATH" ] || [ ! -d "$QT_PATH" ]; then
417406
echo "No Qt >= ${QT_MIN_VERSION} found under ${QT_ROOT}. Aborting."
418407
exit 1
419408
fi
420409
fi
410+
echo "Using Qt root: $QT_ROOT"
421411
echo "Using Qt installation: $QT_PATH"
422412

423413
# Check for cmake, and prefer the one bundled with Qt

0 commit comments

Comments
 (0)