ffmpegthumbnailer icon indicating copy to clipboard operation
ffmpegthumbnailer copied to clipboard

Build failure: ffmpeg detected but headers dir not propagated

Open dmacks opened this issue 5 years ago • 4 comments

I'm trying to build version 2.2.2 on my OS X 10.13 machine, with ffmpeg4 (and all other deps) supplied by fink, cmake detects ffmpeg:

-- Checking for module 'libavcodec'
--   Found libavcodec, version 58.54.100
-- Checking for module 'libavformat'
--   Found libavformat, version 58.29.100
-- Checking for module 'libavutil'
--   Found libavutil, version 56.31.100
-- Checking for module 'libavfilter'
--   Found libavfilter, version 7.57.100
-- Found FFmpeg: 1  
-- FFmpeg found: TRUE
--   avcodec:  /sw/lib/ffmpeg-4.0/lib/libavcodec.dylib
--   avformat: /sw/lib/ffmpeg-4.0/lib/libavformat.dylib
--   avfilter: /sw/lib/ffmpeg-4.0/lib/libavfilter.dylib
--   avutil:   /sw/lib/ffmpeg-4.0/lib/libavutil.dylib

but then does not pass the flags correctly, therefore compiling of moviedecoder.cpp fails:

/sw/var/lib/fink/path-prefix-clang/c++  -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -I/sw/build.build/ffmpegthumbnailer-2.2.2-1/ffmpegthumbnailer-2.2.2/finkbuild -I/sw/include  -MD -O3 -DNDEBUG -fPIC   -std=c++11 -o CMakeFiles/libffmpegthumbnailerobj.dir/libffmpegthumbnailer/moviedecoder.cpp.o -c /sw/build.build/ffmpegthumbnailer-2.2.2-1/ffmpegthumbnailer-2.2.2/libffmpegthumbnailer/moviedecoder.cpp
/sw/build.build/ffmpegthumbnailer-2.2.2-1/ffmpegthumbnailer-2.2.2/libffmpegthumbnailer/moviedecoder.cpp:28:10: fatal error: 
      'libavutil/display.h' file not found
#include <libavutil/display.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

Looking at the CMakeFiles/*.dir/flags.make, both ffmpegthumbnailer and libffmpegthumbnailerstatic have the correct flags in their respective CXX_INCLUDES, but libffmpegthumbnailerobj does not.

Version 2.1.1 built fine.

dmacks avatar Jan 06 '20 16:01 dmacks

I made a commit to master. Can you verify if this fixes your issue?

dirkvdb avatar Jan 07 '20 12:01 dirkvdb

Applying 339ebc5:

-- Found PNG: /sw/lib/libpng.dylib (found version "1.6.37") 
CMake Error at CMakeLists.txt:95 (target_link_libraries):
  Object library target "libffmpegthumbnailerobj" may not link to anything.


-- Configuring incomplete, errors occurred!

I'm usiung -DENABLE_SHARED=OFF -DENABLE_STATIC=ON if that matters.

dmacks avatar Jan 07 '20 15:01 dmacks

Use master. It's more than 1 commit. I bumped the minimum cmake versions which changes object library linking behavior

dirkvdb avatar Jan 07 '20 15:01 dirkvdb

That solved it. Thanks!

dmacks avatar Jan 07 '20 17:01 dmacks