Skip to content

Instantly share code, notes, and snippets.

@scivision
Created August 6, 2025 07:18
Show Gist options
  • Save scivision/de1cd4b1bbdb475dbbcaa34ab3195249 to your computer and use it in GitHub Desktop.
Save scivision/de1cd4b1bbdb475dbbcaa34ab3195249 to your computer and use it in GitHub Desktop.
CMake beep the terminal
# Makes a beep sound, if not disabled by the kernel or terminal.
# This is useful for long-running scripts to signal completion.
if(UNIX)
execute_process(COMMAND printf \\007)
else()
execute_process(COMMAND cmd /c "rundll32 user32.dll,MessageBeep")
# Rundll32 is much faster than invoking PowerShell, but Powershell also works:
# execute_process(COMMAND pwsh -c "Write-Host `a")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment