#!/usr/bin/env bash # Build-container: run ONE build pass of the repo (CMake configure + compile), # mounting the repo so build artifacts land on the host filesystem. # # Usage: tools/docker/docker_build.sh [extra cmake args...] # It builds BOTH part1 (C/C++) and part3 (Qt) unless you pass args to restrict. # The Qt part is pointed at the isolated .qt514/ toolchain. # # After this, run compiled apps on the HOST with tools/run_qt.sh / tools/run.sh. set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" IMAGE_TAG="qt-course:builder" QT_ROOT="/workspace/.qt514/5.14.2/gcc_64" if [ ! -x "$REPO_ROOT/.qt514/5.14.2/gcc_64/bin/qmake" ]; then echo ">> Isolated Qt not found at .qt514/. Run tools/docker/docker_install_qt.sh first." >&2 exit 1 fi docker run --rm \ -v "$REPO_ROOT:/workspace" \ -w /workspace \ "$IMAGE_TAG" \ bash -lc " set -e cmake -S . -B build -G Ninja \ -DBUILD_QT_PART=ON \ -DCMAKE_PREFIX_PATH='${QT_ROOT}' \ -DCMAKE_BUILD_TYPE=Debug \ $* cmake --build build --parallel " echo ">> Build done. Run on host: tools/run.sh (Qt targets: tools/run_qt.sh )"