CMake for Qt Creator not compiling

• May 24, 2013 - 02:48

On Windows,
I've been trying to follow the instructions to use the Qt Creater IDE for the last four hours http://musescore.org/en/developers-handbook/compile-instructions-window….

I've followed the instructions and tried performing "run CMake" in the Qt Creator dialogue box. This just freezes up the screen without doing anything. So, I've tried manually running CMake from the command prompt:
C:\Sites\MuseScore>cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=build/m
ingw32.mingw.cmake -DCMAKE_INSTALL_PREFIX=../win32install

This is just producing bizarre results. I apologize for posting nearly the entire output. I would usually trim the output so that only the relevant problem displayed. However, there are so many warnings and errors here that I can't tell what's significant and what's not:

...........................................................

-- Building for: NMake Makefiles
CMake Warning at CMakeLists.txt:20 (project):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.

-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
CMake Warning at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platfo
rm/Windows-GNU.cmake:64 (enable_language):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU-
C.cmake:1 (include)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cma
ke:56 (include)
CMakeLists.txt:20 (project)

CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not found. Ple
ase set CMAKE_RC_COMPILER to a valid compiler path or name.
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Warning at CMakeLists.txt:2 (PROJECT):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.

CMake Warning at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platfo
rm/Windows-GNU.cmake:64 (enable_language):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU-
C.cmake:1 (include)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cma
ke:56 (include)
CMakeLists.txt:2 (PROJECT)

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeRCI
nformation.cmake:22 (get_filename_component):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU.
cmake:64 (enable_language)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU-
C.cmake:1 (include)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cma
ke:56 (include)
CMakeLists.txt:2 (PROJECT)

CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTes
tCCompiler.cmake:61 (message):
The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test
program.

It fails with the following output:

CMake will not be able to correctly generate this project.
...
...

...........................................................

Thank you for your patience.


Comments

I have never used the QtCreator, so I don't know if the following can actually help. I am just trying to guess possible problems.

1- Have you checked that the PATH contains all needed directories (CMake, MinGW, Qt)?

2- Is it correct the address to the mingw32.mingw.cmake file? Are you sure that a leading "../" is not missing?

3- From the Makefile used by the command-line script I see that CMake has the following two options in addition to the one you quoted in the post:
-DCMAKE_MAKE_PROGRAM=mingw32-make.exe
-G "MinGW Makefiles"

If the previous two points do not work, you can try to add also these.

Hope that helps.
Ciao,
ABL

In reply to by ABL

Thank you for your help. Adding those last two lines in the Command Prompt seemed to have accomplished "something". However, I still can't manage to open anything in Qt Creator itself. Also, the files haven't been generated in their own folder. They seem to have been distributed across my Musescore checkout directory.

I'm a bit testy right now -- and apologize for it -- but I'm very close to just throwing away Qt Creator. Whenever I try to load a project, I get as far as the CMake Wizard. I load all the arguments as requested (and do every other thing I've been told to do), but when I hit "Run Cmake" the wizard does absolutely nothing! The buttons fade. The box just sits there!

Is there anyone here with experience with Qt Creator? Is it even worth trying to use it for Musescore? It seems to be the only suggested IDE, and without some kind of testing environment, I have no idea how I'm going to examine code and actually see what it does. If Qt Creator becomes a lost cause, how else can I experiment with Musescore? I obviously don't want to rebuild the entire project every time I missed a parentheses.

Again, thanks everyone for their assistance.

In reply to by Brindisi

Qt Creator is the best tool for the job. If the Cmake wizard doesn't work, you may have a configuration problem. Check Tools -> Options -> Build and Execute. Make sure you have a Kit, a Qt install and a compiler correctly setup.
If you have files a little bit everywhere, you didn't complete the first step of the Cmake wizard where you choose the output build directory.

You can also run build MuseScore from the command line and use any text editor. You will not need to rebuild the entire project everytime, the build process will build only the modified file and their dependency.

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