NOTE: These instructions are work-in-progress and will be finalized closer to the release of Audacity 4.
- Git
- CMake
- A package manager (tested: Choco on Windows, Homebrew on macOS)
- A CMake generator (tested: Ninja)
- A C++ compiler (tested: MSVC on Windows, g++ on Linux)
- Qt 6.9.1 'Desktop' (macOS), 'MSVC 2022 64-bit' (Windows) or 'MSVC 2022 ARM64' (Windows on ARM) with 'Additional Libraries':
- Qt 5 Compatibility Module
- Qt Network Authorization
- Qt Shader Tools
- Qt State Machines
NB: Bear in mind that, by default, only the latest version of Qt is available for installation. To view older versions, click 'Show > Archive' in the top-right corner of the Qt Online Installer, next to the search bar.
As large parts of Audacity 4 are based on MuseScore Studio, the general setup steps from it are applicable here too:
To get the source and submodules in one command, git clone --recurse-submodules https://github.com/audacity/audacity.git in the folder of your choice. See the Github help for more information.
If you haven't installed the dependencies listed above, now is the time to do so.
Ninja should be able to handle the other dependencies; if it doesn't, the list may be inferred from the "setup" file in buildscripts/ci/{your OS}/.
NB: At the moment, the list is rather long due to MuseScore dependencies that have not yet been cleaned up.
Git, CMake, Ninja, Package manager, Compiler and Qt should all be added to the PATH variable in your OS. Otherwise, you'll need to specify them in the CMakeCache later on.
Using QtCreator to edit and compile will provide the best intellisense and debugging support when interacting with QML. Nevertheless, debugging on Windows is slow, and if you mostly interact with the C++ code, you might want to consider other options, such as those listed below.
To compile, just open CMakeLists.txt with QtCreator, configure the project with the auto-detected Qt kit, and hit Build.
Standard CMake building applies:
# inside the Audacity source:
cmake -S . -B build/ [options] # configure (first build only)
cmake --build build/ # build (every build)
cmake --install build/ # install (every successful build)
Double-click the generate_sln.bat script in the root of the repository. This will generate a Visual Studio solution in the build directory and build the install target. Open the generated solution (./build/audacity.sln) in Visual Studio and press F5 to run Audacity.
TODO: generalize to other OSes
Note: the default generator is Ninja. Have it installed, or change the "cmake.generator" value in .vscode/settings.json to something else (eg Visual Studio 16 2019).
One way of doing this is by executing Ctrl+Shift+P and choosing "Open Workspace from File". Navigate to the root of the repository and select the .vscode/audacity.code-workspace file. Otherwise, you can open the folder, then the workspace file, and click the "Open Workspace" button.
When opening the repository in VSCode, you will be prompted to install recommended extensions. You can do it then. If you missed it, you can install them later by executing Ctrl+Shift+P, typing Extensions: Show Recommended Extensions, and installing the recommended extensions.
You should only have to do this once.
Execute Ctrl+Shift+P and choose "CMake: Configure".
Just press F5. It will build and install everything the first time, but afterwards it should be very fast, especially if you're using Ninja :).