musescore qt creator compile not finding gch.cmake

• Aug 20, 2012 - 22:49

This is a developer query. I'm following your page in the Musescore developers handbook - Compile instructions (Windows - MinGW) - Git. Everything works fine and I have got Musescore 2 beta to compile using the command line. However the final (crucial) debugging section using Qt Creator IDE does not work as it specifies. So far I'm not so familiar with QT Creator, but when I follow the instructions to open CMakeLists.txt and add the arguments
-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=../build/mingw32.mingw.cmake
I get errors
CMake Error at CMakeLists.txt:21 (include):
include could not find load file:

C:/musescore/ms/mscore/build/gch.cmake

The compiler seems to be looking for the /build folder as a subfolder to mscore which of course it isn't - it's off /ms. I've tried everything I can think of to tell it to read C:/musescore/ms/ as the project directory but to no avail. Can you tell me how to get this to work?
Many thanks for your help.


Comments

I updated the instructions.

Don't choose CMakeLists.txt from mscore/ but from the root directory. Also change
-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=../build/mingw32.mingw.cmake
to
-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=build/mingw32.mingw.cmake

I look forward for your first pull request!

In reply to by [DELETED] 5

Hi, and thanks for the feedback. I have tried using CMakeLists.txt in the root folder with amended arguments as you suggest, and now I get

CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:95 (MESSAGE):

Could not find toolchain file: build/mingw32.mingw.cmake

The file build/mingw32.mingw.cmake is present. Any ideas?

Thanks

In reply to by [DELETED] 5

There doesn't seem to be a file CMakeLists.txt.user in the root. Here's the complete error list I'm getting now.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:95 (MESSAGE):
Could not find toolchain file: build/mingw32.mingw.cmake

Call Stack (most recent call first):
CMakeLists.txt:21 (project)

CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:C:/musescore/qtcreator-build/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:C:/musescore/qtcreator-build/CMakeFiles/CMakeCXXCompiler.cmake

Does any of this suggest a solution? Do I have to set up anything special in Qt Creator itself?

In reply to by schepers

Ok. My fault, I hadn't done a full reboot after installing and changing the paths. This is the second computer I tried this on and of course I did all that on the first one but it still didn't work. Now it's finding mingw32.mingw.cmake in the \build folder. However it's now failed on the next step

CMake Error at CMakeLists.txt:134 (message):
Fatal error: QT (version >= 4.8.0) required. Cmake tries to detect QT4 by
searching for 'qmake' in your PATH.If you have QT4 installed, make sure
qmake is found in your PATH. If you compiled QT4 yourself make sure your
new qmake is found _first_ in your PATH.

The path for qmake is in the PATH statement - C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin; but it still doesn't find it. I'm already using CMake 2.8.9. Any idea what could be the cause of this?

After the above error it continues

found Doxygen
-- latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user inetraction on doxy run.
-- makeindex command MAKEINDEX_COMPILER not found but usually required.
-- dvips command DVIPS_CONVERTER not found but usually required.
-- configured C:/musescore/build/Doxyfile.in --> C:/musescore/qtcreator-build/Doxyfile
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE) (Required is at least version "4.8")

Thanks

In reply to by [DELETED] 5

I hadn't added the path to CMake to the Qt Creator field in Build and Run. Once I did that it found everything and compiled the program. Thanks for your help.
However, when I hit the Debug button it immediately comes up with the error

During startup the program exited with code 0xc0000135

Is this a known problem, or is there something which hasn't compiled properly? The were quite a few red and amber warnings.

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