neuromancer / avp

Aliens vs Predator Linux enhanced with cutscene support and new screen resolutions
Other
42 stars 7 forks source link

can't build on fedora #3

Open SingingBush opened 5 years ago

SingingBush commented 5 years ago

Fedora 29 cmake 3.12.1

cmake runs fine with cmake -DCMAKE_BUILD_TYPE=Release -DAVP_BUILD_TYPE=DESKTOP .. but then when I run make it has an issue with the include for libraries that are part of ffmpeg:

$ make
Scanning dependencies of target avp
[  0%] Building C object CMakeFiles/avp.dir/src/bink.c.o
~/CLionProjects/avp-master/src/bink.c:12:9: note: #pragma message: The includes for these are in ffmpeg
 #pragma message("The includes for these are in ffmpeg")
         ^~~~~~~
~/CLionProjects/avp-master/src/bink.c:13:10: fatal error: libavcodec/avcodec.h: No such file or directory
 #include "libavcodec/avcodec.h"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/avp.dir/build.make:63: CMakeFiles/avp.dir/src/bink.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/avp.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

but I have them on my system under /usr/include/ffmpeg/

neuromancer commented 5 years ago

Can you install libav, instead of ffmpeg? In fact, I don't know how libav is installed in Fedora (I'm using Arch/Ubuntu), but you should have the header files in /usr/include/libavcodec/

SingingBush commented 5 years ago

to get libavcodec and other related stuff on Fedora you'd need to add the RPMfusion repository then sudo dnf install -y ffmpeg-devel which would give:

/usr/include/ffmpeg/libavcodec/ /usr/include/ffmpeg/libavdevice/ /usr/include/ffmpeg/libavfilter/ /usr/include/ffmpeg/libavformat/ /usr/include/ffmpeg/libavresample/ /usr/include/ffmpeg/libavutil/ /usr/include/ffmpeg/libpostproc/ /usr/include/ffmpeg/libswresample/ /usr/include/ffmpeg/libswscale/

I tried tweaking the find_component macro in CMakeFFmpegLibavMacros.cmake to get it working but didn't get it to work.

runlevel5 commented 4 years ago

It is because the headers are inside /usr/include/ffmpeg, you could patch the CMakeLists.txt to include that path

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ae2a49..83ff5b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,8 @@ ENDIF(AVP_BUILD_TYPE STREQUAL "WEB")

 PROJECT(avp)

+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/include/ffmpeg")