Setting Up a Development Environment for Windows - Jojo-Schmitz/MuseScore GitHub Wiki

Windows 10/11 with Visual Studio 2022 and Qt 5.15.2

Overview

  1. Download and Install Software Components

    • Microsoft Visual Studio
    • Qt
    • JACK
    • 7-Zip
    • MuseScore 3 Dependencies
  2.  Download MuseScore 3.7 Source Code

  3.  Build MuseScore 3.7


1. Software Components

You can skip download and installation of components that you already have installed on your computer.


1.1 Download Software Components

  • Create a local folder on your computer that is not sync'd to a cloud service. (Example: C:\MS3\Downloads)

  • Download Microsoft Visual Studio Community 2022
    This version is free for contribution to open source projects: Microsoft Visual Studio Community 2022

  • Download the Qt Online installer for your OS
    This version is free for open source use: Qt Online Installer

  • Download the latest 64-bit release of JACK
    JACK is free to include in your projects: GitHub JACK Releases

  • Download the 7-Zip installer for your OS.
    This free software handles .7z compressed archives: 7-Zip

  • Download the MuseScore 3 Dependencies archive, (7-zip file).
    The archive file contains the following individual components:

    • LAME
    • libogg
    • libsndfile
    • libvorbis
    • libvorbisfile
    • Portaudio
    • WinSparkle
    • zlib

    Download directly from this link: MuseScore 3 Dependencies

  • You now have all the required software in your downloads folder:

    dev01


1.2 Install Software Components

Install the software components to non cloud sync'd locations on your computer.


1.2.1 Install Microsoft Visual Studio 2022

  • Run the installer from the downloads folder.
  • On the Workloads tab select Desktop Development with C++

vs01

  • Click on Install to complete the installation.

Add the Qt VS Tools Extension

  • Open Visual Studio
  • On the Extension menu select Manage Extensions
  • In the search box enter Qt
  • Install the Qt Visual Studio Tools from Qt Group

vs03

  • Close Visual Studio when requested to trigger the installation of this extension.

1.2.2 Install Qt 5.15.2

  • Run the online installer from the download folder.
  • A Qt account is required to install the software.
  • Use your existing Qt account details or create a new (free) account from the installer by using the Sign up option.
  • At the Installation Folder step make sure to choose Custom Installation then click Next

qt01

  • At Select Components tick Archive, then press Filter to show older versions of Qt.

  • Select Qt 5.15.2 and other components as shown.

    Notes:

    • Qt Design Studio is not needed, Qt Designer is, but comes as part of Qt Creator.
    • From Qt 5.12.2 you only need MSVC 2019 64-bit (if you want to build for 64-bit Windows) and/or MSVC 2019 32-bit (if you want to build for 32-bit Windows) and Qt WebEngine, Qt Network Authorization and Qt Debug Informations Files, none of the other parts are needed.
    • From the Build Tools You may want to include the OpenSSL Toolkit, the binaries only, source code is not needed.

qt02

Click Next then follow the installation through to the end. (This install can take a little while.)

Add Qt to the Windows System Path

  • Open Windows Settings and search for env

  • Select Edit the system environment variables

    sys01

  • Click the Environment Variables button

  • In System Variables, select Path then Edit

  • Add the path of your Qt bin folder on the first blank line

  • You can type it in manually or browse for it

  • Example:

    sys02

  • Click OK then OK to confirm the change


1.2.3 Install JACK

  • Run the installer. Follow the prompts.

    jack


1.2.4 Install 7-Zip

  • Run the installer. Follow the prompts.

    7zip


1.2.5 Extract the Dependencies

  • Open the downloaded dependencies.7z file and select Extract to extract the contents.

  • This create a dependencies folder with these contents:

    depd01

  • The libx86 folder can get deleted, if you don't intend to build for 32-bit Windows. Likewise for the libx64 folder and 64-bit Windows.


This completes the software installation.
The next step is to download the MuseScore 3.7.0 source code and to configure Visual Studio to build the MuseScore executable.


2. Download MuseScore 3.7 Evolution Source Code

  • The source code is hosted on GitHub in a repository owned by Joachim 'Jojo' Schmitz.
  • You first need to make your own GitHub copy of this repository. This is called a fork.
  • Then you need to clone your copy to your local computer.

2.1 Forking the MuseScore 3.x Branch

The page should look like this:

GitHub01

  • Click on the Fork button near the top-right of the page

  • Choose a name for your copy of the repository

    fork02

  • Click the Create Fork button at the bottom-right.

  • It only takes seconds to create your new repository, which is a copy of Jojo's 3.x branch.

  • Your repository is now ready to be cloned to your local computer.

    fork03


2.2 Cloning Your Repository to Your Local Computer

  • Open Visual Studio 2022

  • Choose Continue without code

  • On the main menu select Git then Clone Repository

  • Copy and paste the URL of your personal MuseScore 3.x repository into the Repository location field.

  • Select a path for your local copy in the Path field

    • Note: The details shown below are only my examples
    • Make sure to use the values for your personal repository and preferred path

    Repo01

  • Click the Clone button

  • Wait while your repository is cloned from GitHub to your local computer

    Repo02

  • Close Visual Studio


2.3 Add the MuseScore 3 Dependencies to Your Local Repo

  • Move the dependencies folder created in step 1.2.5 into your cloned repo.

    Repo03


2.4 Configure Qt in Visual Studio

  • Open Visual Studio

  • From the Extensions menu select Qt VS Tools and then Qt Versions

  • Click on Autodetect to finish the setup

    vs02


The MuseScore source code and all dependencies are now ready for a build.


3. Build MuseScore 3.7

3.1 Run CMake

  • In Visual Studio click on File then Open then Folder

  • Select your MuseScore 3.7 Repo folder

  • This will start CMake which should complete with the message CMake generation finished

    CMake01

  • Set the Target System to Local Machine and Configuration to x64 Release

    CMake02

  • This will re-run CMake which should again finish with CMake generation finished

  • From the Build menu select Build All

  • This will process the local repo and should complete with the message Build All succeeded.

  • From the Build menu select Install mscore which should finish with Install succeeded.

    Build01

  • This creates MuseScore3.exe in the folder indicated before the Install succeeded message.

  • Your local version of MuseScore 3.7 Evolution is ready to run!

    Note: Run MuseScore from the install location, not from the build location.

3.2 Tidy up

MSVC 2022 will build the solution in the out folder and this will trigger many items in the Git change log:

gitignore01

These are not relevant to any upstream changes and can be excluded from the change log.

  • Add out after dependencies in the .gitignore file to disregard files in the build's out folder:

    gitignore02

  • Now the change log will be reflect only 'real' changes:

    gitignore03