Yalir / sfeMovie

sfeMovie is a simple C++ library that lets you play movies in SFML based applications. It relies on FFmpeg to read medias and remains consistent with SFML's naming conventions.
http://sfemovie.yalir.org/
GNU Lesser General Public License v2.1
114 stars 37 forks source link

Allow linking against the system FFmpeg library or another provided FFmpeg library #31

Closed Ceylo closed 10 years ago

Ceylo commented 11 years ago

AC:

firefly2442 commented 11 years ago

I received the following error when building and linking against the version of FFmpeg provided with sfeMovie:

rm: cannot remove ‘../ffmpeg-build/*’: No such file or directory
Copying libraries into ffmpeg-build
‘./libavutil/libavutil.so’ -> ‘../ffmpeg-build/libavutil.so’
‘./libavutil/libavutil.so.51’ -> ‘../ffmpeg-build/libavutil.so.51’
‘./libswresample/libswresample.so.0’ -> ‘../ffmpeg-build/libswresample.so.0’
‘./libswresample/libswresample.so’ -> ‘../ffmpeg-build/libswresample.so’
‘./libavdevice/libavdevice.so.54’ -> ‘../ffmpeg-build/libavdevice.so.54’
‘./libavdevice/libavdevice.so’ -> ‘../ffmpeg-build/libavdevice.so’
‘./libavfilter/libavfilter.so.3’ -> ‘../ffmpeg-build/libavfilter.so.3’
‘./libavfilter/libavfilter.so’ -> ‘../ffmpeg-build/libavfilter.so’
‘./libavcodec/libavcodec.so.54’ -> ‘../ffmpeg-build/libavcodec.so.54’
‘./libavcodec/libavcodec.so’ -> ‘../ffmpeg-build/libavcodec.so’
‘./libswscale/libswscale.so’ -> ‘../ffmpeg-build/libswscale.so’
‘./libswscale/libswscale.so.2’ -> ‘../ffmpeg-build/libswscale.so.2’
‘./libavformat/libavformat.so.54’ -> ‘../ffmpeg-build/libavformat.so.54’
‘./libavformat/libavformat.so’ -> ‘../ffmpeg-build/libavformat.so’
Built ffmpeg
[ 87%] Built target BuildFFMPEG
make: *** [all] Error 2
firefly2442 commented 11 years ago

One other alternative option is to use "ExternalProject" provided by CMake. FFmpeg would have to be able to be built from CMake though, not sure if it provides that or not.

http://www.cmake.org/cmake/help/v2.8.11/cmake.html#module:ExternalProject

http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html

Ceylo commented 11 years ago

Could you rebuild sfeMovie by doing make clean then make VERBOSE=1? Because at the moment it fails although everything seems to have gone well (the rm error is not an issue).

As for ExternalProject, what I'm wondering is what is the environment used to do the configure and build step? Because on Unixes you can probably run FFmpeg's configure and make, but on Windows I can't see how that could be possible as the OS doesn't come with a preinstalled bash interpreter and gcc (which is why I'm doing some tricks to make everything work through MinGW at the moment).

firefly2442 commented 11 years ago

Hmm, this is quite perplexing, I'm unable to replicate this issue. My apologies.

As for ExternalProject, I've only used it in one project so far. I believe it uses whatever build system you specify for the main project. It's a way of getting around needing to use FindProjectX.cmake modules and setting CMake variables and just building the project natively as intended (but of course they need to use CMake). I don't really see this as a solution to anything, just an alternative and something to consider.

Ceylo commented 11 years ago

I'm not sure everything is still correct, because make clean won't clean everything. For example it won't remove the FFmpeg binaries. What I would suggest is doing a full repo checkout and verifying again.

As for ExternalProject, I'm going to create a new issue for that.

bluekirby0 commented 10 years ago

make distclean should clear out anything that could be causing problems.

Ceylo commented 10 years ago

Tested successfully on OS X, Linux and Windows with Visual Studio. Still checks with MinGW left.

Ceylo commented 10 years ago

Fixed and tested on MinGW, so finished now :)