BUILDING.md
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 the 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 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. Else, 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 :).