#!/bin/sh

# The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`

# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
original_cmake_path="/private/var/folders/k1/30mswbxs7r1g6zwn8y4fyt500000gp/T/abs_9bg_as8n9h/croot/qtbase_1742934306344/_build_env/bin/cmake"
cmake_path=$original_cmake_path
if ! test -f "$cmake_path"; then
    cmake_path="cmake"
fi

toolchain_path="$script_dir_path/../../cmake/Qt6/qt.toolchain.cmake"

# Find the qt toolchain relative to the absolute bin dir path where the script is located.
exec "$cmake_path" -DCMAKE_TOOLCHAIN_FILE="$toolchain_path"  "$@"
