h4tr3d / avcpp

C++ wrapper for FFmpeg
Other
429 stars 78 forks source link

CMake: INTERFACE_LIBRARY targets may only have whitelisted properties. #103

Closed teowoz closed 7 months ago

teowoz commented 1 year ago

When following the build instructions, the following errors appear:

-- The CXX compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'libavcodec'
--   Found libavcodec, version 58.54.100
-- Checking for module 'libavformat'
--   Found libavformat, version 58.29.100
-- Checking for module 'libavdevice'
--   Found libavdevice, version 58.8.100
-- Checking for module 'libavutil'
--   Found libavutil, version 56.31.100
-- Checking for module 'libavfilter'
--   Found libavfilter, version 7.57.100
-- Checking for module 'libswscale'
--   Found libswscale, version 5.5.100
-- Checking for module 'libpostproc'
--   Found libpostproc, version 55.5.100
-- Checking for module 'libswresample'
--   Found libswresample, version 3.5.100
-- Libs: avcodec | avcodec
CMake Error at cmake/FindFFmpeg.cmake:166 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "IMPORTED_LINK_INTERFACE_MULTIPLICITY" is not allowed.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

-- Libs: avformat | avformat
CMake Error at cmake/FindFFmpeg.cmake:166 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "IMPORTED_LINK_INTERFACE_MULTIPLICITY" is not allowed.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

-- Libs: avutil | avutil
CMake Error at cmake/FindFFmpeg.cmake:166 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "IMPORTED_LINK_INTERFACE_MULTIPLICITY" is not allowed.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

-- Libs: avdevice | avdevice
CMake Error at cmake/FindFFmpeg.cmake:166 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "IMPORTED_LINK_INTERFACE_MULTIPLICITY" is not allowed.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

-- Libs: avfilter | avfilter
CMake Error at cmake/FindFFmpeg.cmake:166 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "IMPORTED_LINK_INTERFACE_MULTIPLICITY" is not allowed.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

-- Libs: swscale | swscale
CMake Error at cmake/FindFFmpeg.cmake:166 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "IMPORTED_LINK_INTERFACE_MULTIPLICITY" is not allowed.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

-- Libs: swresample | swresample
CMake Error at cmake/FindFFmpeg.cmake:166 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "IMPORTED_LINK_INTERFACE_MULTIPLICITY" is not allowed.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

-- Found FFmpeg: /usr/lib/x86_64-linux-gnu/libavcodec.so;avcodec;/usr/lib/x86_64-linux-gnu/libavformat.so;avformat;/usr/lib/x86_64-linux-gnu/libavutil.so;avutil;/usr/lib/x86_64-linux-gnu/libavdevice.so;avdevice;/usr/lib/x86_64-linux-gnu/libavfilter.so;avfilter;/usr/lib/x86_64-linux-gnu/libswscale.so;swscale;/usr/lib/x86_64-linux-gnu/libswresample.so;swresample  
-- LIBS:  / 
-- /home/teo/tly/avcpp-git/tests/../catch2/contrib
-- Configuring incomplete, errors occurred!

Reverting commit 4629a902 fixes the problem and avcpp compiles successfully. I'm using CMake 3.16.3.

h4tr3d commented 1 year ago

@teowoz, sorry, but I can't reproduce issue... currently my CMake is 3.24 but CMake configuration mostly stable for a long time. Could you please check with more newer version of CMake?

jonas-resch commented 1 year ago

This is definitely related to the CMake version. It doesn't work with CMake 3.16.3 (the latest version I could update to on Ubuntu Server 20.04). It works on CMake 3.25.1 and 3.26.3.

Edit: CMake 3.19.0 is the minimum required version