problem while building musescore trunk, misses mscore/revision.h

• Jan 22, 2013 - 18:08
S4 - Minor

I can't compile the current trunk.
I am under fedora 17 64 bits.
An error is printed while compiling:

[ 48%] Building CXX object aeolus/aeolus/CMakeFiles/aeolus.dir/aeolus.cpp.o
cc1plus: attention : /home/collette/repositories/MuseScore/build_tmp/all.h.gch: n'est pas utilisé parce que « NDEBUG » n'est pas définie [-Winvalid-pch]
Linking CXX static library libaeolus.a
[ 49%] Built target aeolus
make[2]: *** Aucune règle pour fabriquer la cible « ../mscore/revision.h », nécessaire pour « mscore/qrc_musescore.cxx ». Arrêt.
make[1]: *** [mscore/CMakeFiles/mscore.dir/all] Erreur 2
make: *** [all] Erreur 2

If I do a touch mscore/revision.h the build goes fine.



Yes, I have removed my build dirrectory, restart cmake and then make. But still the same problem.
The 'touch mscore/revision.h' works fine ...


Under Windows XP (SP 3), I found that after the recent changes, I have to launch "make revision" (well, actually "mingw32-make -f Makefile.mingw revision" after including git/bin folder in the PATH) before performing the "make debug" (or more precisely, "mingw32-make -f Makefile.mingw debug" after removing git/bin from the PATH) or "make release".

To build musescore, I follow these steps:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/mscore-devel ..

So, in my build directory, the make revision doesn't work (I am under linux).


If I understand correctly, "make revision" just creates the file revision.h in the folder mscore, containing the revision number. It is generated by the instruction (inside the MuseScore folder):
git rev-parse --short HEAD > mscore/revision.h
Probably, "touch mscore/revision.h", if such file does not exist, creates an empty file revision.h, which is then used for the compilation (even if empty). I think that if you check the revision number of your built version it will be empty.
So, in summary, I think that the problem is just the absence of a "revision.h" file (since it seems not to be generated by the normal make alone).

> So, in summary, I think that the problem is just the absence of a "revision.h" file (since it seems not to be generated by the normal make alone)

Yes, you're right. revsion.h is not generated by the Makefile and using an empty revision.h allows the compilation to goes on.


My last linux Mint14 (64 bits) trunk build is ab4e2b7 dated jan 22, 22CET, was made using the following script

git pull
make revision
echo password | sudo -S make install

Finally, the main problem comes from the fact that I do not use the Makefile to build mscore, but I use directly the CMakeLists.txt to build mscore.
The rule
@git rev-parse --short HEAD > mscore/revision.h
should be added directly into the main CMakeLists.txt

Why don't you use the makefile? If you need to change CMAKE_INSTALL_PREFIX, you can run

make PREFIX=/opt/mscore-devel

If it solves your problem, can you close the issue?

Yes, I can use the Makefile instead of using cmake manually.
But, usually, this kind of thing (autogeneration of a .h file) should be added directly into a CMakeLists.txt file.
Thanks for the comment, you can close the bug.

I'm using Qt Creator, and running CMake from inside it. I guess running make won't be a solution, right?
In fact, I re-run CMake before building, and then the build failed asking for revision.h

The exact error is:

mingw32-make[2]: *** No rule to make target `../mscore/revision.h', needed by `mscore/qrc_musescore.cxx'.  Stop.

Can anybody add "revision.h" to the issue title? It hasn't been easy to find this issue :-)