Qt-Creator 4.0

• May 13, 2016 - 08:39

Very recently Qt-Creator 4.0 has been released.
It apparently deals with cmake a whole lot different than the prevoius version 3.6.1, and without changes to our CMakeListe.txt files, it won't be able to build MuseScore anymore.

So if you are able to help getting MuseScore to build with Qt-Creator 4.0, please do so, help on that is very welcome.

If, however, you just want to continue being able to build/debug/develop MuseScore, stay on QtCreator 3.6.1 for now...

If you do upgrade to Qt-Creator 4.0, it might be wise to first copy the old QtCreator 3.6.1 to some safe place, so you can switch between theem by just modifying PATH


Comments

I can't speak for Windows, but in Linux I personally find it easier to compile MuseScore with the Makefile rather than by calling CMake directly. Even with Qt Creator I prefer to define custom build and run commands which simply run make rather than using Qt Creator to configure CMake. Hopefully this will still be possible with Qt Creator 4. My configurations:

Build settings

Build directory: ~/src/MuseScore

Build steps:
    make revision
    make installdebug PREFIX=install SUFFIX=-qt LABEL="QtCreator Build" UPDATE_CACHE=FALSE

Clean steps:
    make uninstalldebug
    make clean

Build environment: Use System Environment and set:
    PATH=~/Qt/5.6/gcc_64/bin:${PATH}

Run settings

Executable: build.debug/install/bin/mscore-qt
Working directory: %{buildDir}

Using the Makefile means that you always use the same build configuration as Travis. If the CMake options are changed by a PR then your configuration is updated automatically when you fetch and merge the changes from upstream.

In reply to by shoogle

Thanks for your guide on setting up qtcreator 4.0 to use the makefile...I've successsfuly build on qtcreator 4.0.2 based on Qt 5.7.0 GCC 6.1.1 with distcc.

But I noticed something I believe was a typo in your compile instructions here: https://musescore.org/en/node/98621/revisions/view/191051/198991

When I followed your instructions, pressing build first build release and then built debug. I changed your "make release" to "make revision" to correspond to what your wrote in your comment above, which is what I believe you intended to write.

In reply to by ericfontainejazz

Thanks, well spotted!

The options I use now are slightly different to when I wrote the guide:

  • I set `NO_RPATH=TRUE` in addition to the other option for `make installdebug` This means I have to...
  • set `LD_LIBRARY_PATH=~/Qt/5.6/gcc_64/lib:${LD_LIBRARY_PATH}` as well as setting $PATH.
  • My clean step is just `make clean`. `make uninstalldebug` is only needed if installing outside the build directory (e.g. into /usr/local/), but here we install into the build directory which gets deleted with `make clean` anyway.
  • I don't add the project to git version control. (I still use git but I do it from the command line because I don't like QtCreator's git interface.)
  • I add these file extensions to the list of imported types: *.ui; *.qrc; *.xml;

But these steps are all optional really.

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