Compiling MuseScore on macOS without full Xcode

• Jan 9, 2019 - 17:53

With reference to Trouble with pre-compiled headers on macOS from last year, starting a new thread in this forum, since that is what Iasconic recommended.

I understand it is possible to compile MuseScore on macOS, if the headers were modified accordingly to remove references to or dependencies on full Xcode, e.g. only require the "Xcode Command Line Tools"

shoogle did this great write-up of Qt without Xcode

Would it be possible to modify the MuseScore headers to compile without full Xcode?

My reasons/justifications (borrowed from shoogle’s document)

  • Xcode is a 6GB download and on disk. With either bandwidth or SSD space at a premium, downloading the full Xcode and keeping it up to date is unnecessary and wasteful.
  • Qt doesn't actually need the full IDE. Only Xcode's command line utilities are required for macOS application development.
  • Developers may never actually use Xcode. They can program in Qt Creator, like they do in Windows and Linux.

The use case specific to MuseScore

  • Compiling from source is a lot more efficient that downloading the nightlies regularly.
  • For the casual user just starting out with MuseScore from source, the huge Xcode download might be discouraging, or even prohibitive.

Comments

This shouldn't be too difficult since the alternative to Xcode is Make, which is already used on Unix systems. It probably just requires going through all the CMakeLists.txt files and looking for things like:

if (APPLE)
  # code for building on macOS
else (APPLE)
  # code for building on Linux
endif (APPLE)

 
and, if necessary, replacing it with either:

if (XCODE)
  # code for building with Xcode (any OS)
else (XCODE)
  # code for building with Make (any OS)
endif (XCODE)

 
or with:

if (APPLE)
  if (XCODE)
    # code for building with Xcode on macOS
  else (XCODE)
    # code for building with Make on macOS
  endif (XCODE)
else (APPLE)
  # code for building with Make on Linux
endif (APPLE)

 
depending on whether the steps with Make on macOS are different to the other platforms.

Of course there are a few extra details to be aware of:

  • Windows exists (i.e. you will also see "if (WIN32)", "if (MSVC)" and "if (MINGW)").
  • You might need to change some #define and #ifdefined statements in the header files.

Do you still have an unanswered question? Please log in first to post your question.