#!/bin/bash script_dir=$(readlink -f $(dirname "$0")) pushd $script_dir # Create build directory if it doesn't exist if [ ! -d "build/tmp" ]; then # Configure project using CMake with Ninja generator for Release build cmake -B build/tmp -G Ninja -DCMAKE_BUILD_TYPE=Release fi # Build project using Ninja cmake --build build/tmp --config Release # Create bin directory if it doesn't exist mkdir -p bin # Copy binary to bin folder # Use .exe extension on Windows, no extension on Unix-like systems if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then cp build/tmp/r3_gh_tool.exe bin/ else cp build/tmp/r3_gh_tool bin/ fi popd