robjones90

CMake fix

Aug 24th, 2025 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.40 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Build script for PocketMage Desktop Emulator (Test Version)
  4. set -e
  5.  
  6. echo "[INFO] Building PocketMage Desktop Emulator (Test Version) for macOS"
  7.  
  8. # Check dependencies
  9. echo "[INFO] Checking dependencies..."
  10.  
  11. # Check for SDL2 via Homebrew
  12. if brew list sdl2 &>/dev/null && brew list sdl2_ttf &>/dev/null; then
  13.     echo "[SUCCESS] SDL2 and SDL2_ttf found via Homebrew"
  14. else
  15.     echo "[ERROR] SDL2 or SDL2_ttf not found. Please install with:"
  16.     echo "  brew install sdl2 sdl2_ttf"
  17.     exit 1
  18. fi
  19.  
  20. # Check for CMake
  21. if command -v cmake &> /dev/null; then
  22.     CMAKE_VERSION=$(cmake --version | head -n1 | cut -d' ' -f3)
  23.     echo "[SUCCESS] Found CMake $CMAKE_VERSION"
  24. else
  25.     echo "[ERROR] CMake not found. Please install with:"
  26.     echo "  brew install cmake"
  27.     exit 1
  28. fi
  29.  
  30. # Create build directory
  31. BUILD_DIR="build-test"
  32. echo "[INFO] Creating build directory: $BUILD_DIR"
  33. mkdir -p "$BUILD_DIR"
  34.  
  35. # Configure build with CMake
  36. echo "[INFO] Configuring build with CMake..."
  37. cd "$BUILD_DIR"
  38. cmake .. -DCMAKE_BUILD_TYPE=Debug
  39.  
  40. # Build project
  41. echo "[INFO] Building project..."
  42. make -j$(sysctl -n hw.ncpu)
  43.  
  44. echo "[SUCCESS] Build completed successfully!"
  45. echo "[INFO] Executable: $(pwd)/PocketMage_Desktop_Emulator"
  46. echo "[SUCCESS] Assets copied to build directory"
  47.  
  48. echo "[INFO] To run the emulator:"
  49. echo "[INFO]   cd $BUILD_DIR"
  50. echo "[INFO]   ./PocketMage_Desktop_Emulator"
Advertisement
Add Comment
Please, Sign In to add comment