-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Compile in Qt Creator
You must have followed the steps to install Qt and Qt Creator and get MuseScore's source code.
Launch Qt Creator. From the File menu or Welcome screen, use the option to open an existing project. (Don't use the option to create a new project.)
Open the CMakeLists.txt file in the root of MuseScore's code directory.
You will be asked to choose a build kit. You have one build kit for each version and compiler of Qt you have installed.
Pick any build kit and enable at least one build configuration for it. The possible configurations are:
- Debug: Special symbols will be added to the compiled executable to enable advanced debugging techniques (set breakpoints, pause the running application, step through code line-by-line and see the value of each variable, etc.).
- Release: All debug symbols are removed to create a smaller executable that runs faster on end-users' machines.
- RelWithDebInfo: A compromise between Release and Debug that includes some symbols for limited debugging.
- MinSizeRel: Release build with further optimizations applied that may sacrifice some performance in return for a smaller executable size.
As a developer using an IDE, it only really makes sense to use Debug or RelWithDebInfo. Use RelWithDebInfo if you find Debug builds are too slow. You can disable the other configurations.
Tip: If you want to work on the Release configuration for deployment to end-users then you should compile on the command line using the same method as the CI scripts.
By default, Qt Creator will compile the project but not install it. This gives you a program that basically works, but it will be missing certain features that rely on external resources such as fonts, sounds, and score templates for the New Score Wizard. If you want access to these things (recommended) then it is necessary to install the program.
Once the initial configuration is complete, switch to the Projects screen. The Build & Run section on the left should list available build kits. Enabled kits look like this:
- 🖥️ Desktop Qt [version] [compiler]
- 🔨 Build
- ▶ Run
From the Projects screen, click "Build" under your chosen kit to be taken to the Build Settings page for that kit.
Type "install" in the Filter box on the right and locate the variable CMAKE_INSTALL_PREFIX
. The default value of this variable is /usr/local
on Linux and macOS, or C:\Program Files
on Windows, but we don't want to install to those locations (and you can't anyway without root/Administrator privileges). Instead, we want to install to a new directory called install
located directly inside the build directory. To do this:
- Locate where the build directory is displayed higher up the screen.
- Right-click on the build directory path and choose "Select All", then right-click again and choose "Copy".
- Double-click inside the value for
CMAKE_INSTALL_PREFIX
and delete the current value. - Paste the build directory in
CMAKE_INSTALL_PREFIX
as the new value and type/install
after it. - Press Enter to confirm the new value, then click "Apply Configuration Changes".
From the Projects screen, click "Run" on the left under your chosen kit to go to the Run Settings page.
Under Deployment, click "Add Deploy Step" > "CMake Build". The default settings are fine (cmake.exe --build . --target install
).
To the right of "Run configuration", click "Add...". Choose "Custom Executable" and enter the following:
Executable:
-
Linux:
%{buildDir}/install/bin/mscore
-
macOS:
%{buildDir}/install/mscore.app/Contents/MacOS/mscore
-
Windows:
%{buildDir}/install/bin/MuseScore4.exe
Command line arguments: (leave blank or add any valid arguments)
Working directory: %{sourceDir}
To compile the program, click the large green arrow with the bug symbol in the bottom left of the screen. Click the "Compile Output" tab at the bottom of the screen to follow the progress of the build and check for errors if it fails.
If the code compiles successfully then MuseScore will launch automatically as soon as the build is complete. Click the "Application Output" tab at the bottom of the screen to view MuseScore's command line output and debug messages.
Testing
- Manual testing
- Automatic testing
Translation
Compilation
- Set up developer environment
- Install Qt and Qt Creator
- Get MuseScore's source code
- Install dependencies
- Compile on the command line
- Compile in Qt Creator
Beyond compiling
Misc. development
Architecture general
- Architecture overview
- AppShell
- Modularity
- Interact workflow
- Channels and Notifications
- Settings and Configuration
- Error handling
- Launcher and Interactive
- Keyboard Navigation
Audio
Engraving
- Style settings
- Working with style files
- Style parameter changes for 4.0
- Style parameter changes for 4.1
- Style parameter changes for 4.2
- Style parameter changes for 4.3
- Style parameter changes for 4.4
Extensions
- Extensions overview
- Manifest
- Forms
- Macros
- Api
- Legacy plugin API
Google Summer of Code
References