MantisBT - VCMI
View Issue Details
0001188VCMIOtherpublic2013-01-26 16:352014-05-30 17:41
t3st3r 
Ivan 
highmajoralways
closedfixed 
AMD64Xubuntu 12.10 64-bit12.10
 
0.91 
0001188: Cmake fails on libav/ffmpeg detection in Ubuntu: detection succeeds but build ends with error due to lack of some libav parts.
Ffmpeg/libav detection in your cmake build system is currentlyl broken. It falsely passes check but then build fails later due to missing libraries.

$ cmake CMakeLists.txt
-- Boost version: 1.50.0
-- Found the following Boost libraries:
-- program_options
-- filesystem
-- system
-- thread
-- DEFAULT_MESSAGE (missing: FFMPEG_LIBRARIES)
-- Configuring done
-- Generating done
-- Build files have been written to: /builds/vcmi/vcmi-bld

I.e. detection considered passed and makefiles were generated.

But then:
[ 77%] Building CXX object client/CMakeFiles/vcmiclient.dir/BattleInterface/CCreatureAnimation.cpp.o
In file included from /builds/vcmi/vcmi-bld/client/BattleInterface/CBattleInterfaceClasses.cpp:22:0:
/builds/vcmi/vcmi-bld/client/BattleInterface/../CVideoHandler.h:235:34: fatal error: libavformat/avformat.h: No such file or directory
compilation terminated.
make[2]: *** [client/CMakeFiles/vcmiclient.dir/BattleInterface/CBattleInterface.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....


After installing some more ffmpeg libs and retry it has come to lack of libswscale:
Building CXX object client/CMakeFiles/vcmiclient.dir/UIFramework/Fonts.cpp.o
In file included from /builds/vcmi/vcmi-bld/client/BattleInterface/CBattleInterface.cpp:25:0:
/builds/vcmi/vcmi-bld/client/BattleInterface/../CVideoHandler.h:236:32: fatal error: libswscale/swscale.h: No such file or directory
compilation terminated.
In file included from /builds/vcmi/vcmi-bld/client/BattleInterface/CBattleInterfaceClasses.cpp:22:0:
/builds/vcmi/vcmi-bld/client/BattleInterface/../CVideoHandler.h:236:32: fatal error: libswscale/swscale.h: No such file or directory
compilation terminated.
To reproduce this problem you should have some libav development parts installed in your system to allow cmake to pass libav checks but some parts required by VCMI should be missing.

In my case it looks like if presence of libavformat and libswscale parts of libbav wasn't checked correctly.
Honestly, I'm getting to love autotools-based programs. Your build system had far more troubles than any program I built before.
No tags attached.
Issue History
2013-01-26 16:35t3st3rNew Issue
2013-01-26 17:05IvanNote Added: 0003331
2013-01-26 17:05IvanAssigned To => Ivan
2013-01-26 17:05IvanStatusnew => assigned
2013-01-26 19:40IvanNote Added: 0003334
2013-01-26 19:40IvanStatusassigned => resolved
2013-01-26 19:40IvanFixed in Version => 0.91
2013-01-26 19:40IvanResolutionopen => fixed
2013-01-27 09:49t3st3rNote Added: 0003337
2013-01-27 09:49t3st3rNote Edited: 0003337bug_revision_view_page.php?bugnote_id=3337#r2111
2013-01-27 09:51t3st3rNote Edited: 0003337bug_revision_view_page.php?bugnote_id=3337#r2112
2013-01-27 10:57IvanNote Added: 0003338
2014-05-30 17:41beegeeStatusresolved => closed

Notes
(0003331)
Ivan   
2013-01-26 17:05   
>> Honestly, I'm getting to love autotools-based programs. Your build system had far more troubles than any program I built before.

We had autotools before. And it had much more troubles than cmake.

I think your report is the first issue regarding cmake.
(0003334)
Ivan   
2013-01-26 19:40   
Fixed, rev 3130
(0003337)
t3st3r   
2013-01-27 09:49   
(edited on: 2013-01-27 09:51)
> I think your report is the first issue regarding cmake.
Yes. Because my first 3 attempts were f...ked up so much that I simply don't dared to even try to file bug report. Because I can't even understand what's wrong. So I even did not filed bug report since I can't get idea what's wrong.

Sure, autotools ARE crap. Really horrible crap. But when it actually comes to building something from source on system without all build deps (that's where I need build system's help), it's definitely "least evil" from my experience. At least it usually detects things more or less correctly and would fail with some MEANINGFUL message, it creates adequate log of actions, it can show help with options and parameters before generating makefile, etc.

With cmake I had to resort to reading internals of cmake files. Never had to do somethings as horrible as that with any automake-based program, ever. In fact vcmi is one of most troublesome programs I ever compiled. For example. now I'm trying to get idea how to re-define some install paths. In autocrap-based it's usually a matter of few parameters in configure. Configure would output them if launched with --help, so I can see I can redefine these. But in vcmi... hmm... I found some but not all variables ... after reading source. Which is *much* harder.

(0003338)
Ivan   
2013-01-27 10:57   
List of build deps is present in readme. But I agree that cmake errors are not very intuitive. Not sure if something can be done here

>> Configure would output them if launched with --help, so I can see I can redefine these. But in vcmi... hmm...

The problem is that there is not much to show. Install prefix is probably the only think that can be configured easily. *._DIR defines can be changed too but they need caution. This has nothing to do with autotools or cmake - this is how it always was in vcmi.

Unfortunately this is not something that can be fixed in one day. If somebody will prove that I'm wrong - great.
Probably I'll do some more cleanups after 0.91 release but believe me - build system (and installation on Linux systems in general) is in much better state than it was ~2 years ago