Almamu / linux-wallpaperengine

Wallpaper Engine backgrounds for Linux!
GNU General Public License v3.0
1.6k stars 60 forks source link

ffmpeg not found, even though it's installed #121

Open Simon1511 opened 2 years ago

Simon1511 commented 2 years ago

Hi, I was trying to compile this, but cmake .. throws following error:

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib/ccache/c++
-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Checking for module 'xrandr'
--   Found xrandr, version 1.5.2
-- Found Xrandr: /usr/lib/x86_64-linux-gnu/libXrandr.so  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so   
-- Found GLEW: /usr/include (found version "2.1.0") 
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so  
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found SDL: /usr/lib/x86_64-linux-gnu/libSDLmain.a;/usr/lib/x86_64-linux-gnu/libSDL.so;-lpthread (found version "1.2.15") 
-- Performing Test LZ4_GOOD_VERSION
-- Performing Test LZ4_GOOD_VERSION - Success
-- Found LZ4: /usr/lib/x86_64-linux-gnu/liblz4.so  
-- Found LZ4: /usr/lib/x86_64-linux-gnu/liblz4.so
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:226 (message):
  No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()
Call Stack (most recent call first):
  CMakeModules/FindFFMPEG.cmake:23 (find_package_handle_standard_args)
  CMakeLists.txt:19 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/simon/cr-builds/linux-wallpaperengine/build/CMakeFiles/CMakeOutput.log".
See also "/home/simon/cr-builds/linux-wallpaperengine/build/CMakeFiles/CMakeError.log".

However, the latest version of ffmpeg is installed:

ffmpeg version N-107515-g564d7946de Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: 
libavutil      57. 30.100 / 57. 30.100
libavcodec     59. 39.100 / 59. 39.100
libavformat    59. 29.100 / 59. 29.100
libavdevice    59.  8.101 / 59.  8.101
libavfilter     8. 46.100 /  8. 46.100
libswscale      6.  8.101 /  6.  8.101
libswresample   4.  8.100 /  4.  8.100

I've alredy tried to re-install ffmpeg, and also tried to compile it from source (which installs ffmpeg just fine, but doesn't fix the error).

OS is Ubuntu 20.04.

Thanks in advance!

Svallinn commented 2 years ago

Going completely on a whim here (can't even remember why I'm following this repo, probably because it's interesting) If I'm wrong, you can just wait for Almamu.

Boring details: The problem seems to be CMake, not ffmpeg. Apparently, this project's ffmpeg CMake module is the only one using the non-DEFAULT_MSG FindPackageHandleStandardArgs command signature and using the alternative REQUIRED_VARS/HANDLE_COMPONENTS signature instead.

This normally isn't a problem... unless you have an older version of CMake (specifically lower than 3.18), in which case REQUIRED_VARS is always required even if HANDLE_COMPONENTS is provided, which is the case here.

https://github.com/Almamu/linux-wallpaperengine/blob/8955ba791ca7d492b0b88bd1aa3aae19e32b85b5/CMakeModules/FindFFMPEG.cmake#L21-L27

More information here: https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html

Solution Try to use CMake 3.18 or higher Although, Almamu can probably make it more compatible for older versions. I don't know anything about CMake, I'm just some dude that read the CMake docs for like 5 minutes.

Simon1511 commented 2 years ago

Going completely on a whim here (can't even remember why I'm following this repo, probably because it's interesting) If I'm wrong, you can just wait for Almamu.

Boring details: The problem seems to be CMake, not ffmpeg. Apparently, this project's ffmpeg CMake module is the only one using the non-DEFAULT_MSG FindPackageHandleStandardArgs command signature and using the alternative REQUIRED_VARS/HANDLE_COMPONENTS signature instead.

This normally isn't a problem... unless you have an older version of CMake (specifically lower than 3.18), in which case REQUIRED_VARS is always required even if HANDLE_COMPONENTS is provided, which is the case here.

https://github.com/Almamu/linux-wallpaperengine/blob/8955ba791ca7d492b0b88bd1aa3aae19e32b85b5/CMakeModules/FindFFMPEG.cmake#L21-L27

More information here: https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html

Solution Try to use CMake 3.18 or higher Although, Almamu can probably make it more compatible for older versions. I don't know anything about CMake, I'm just some dude that read the CMake docs for like 5 minutes.

Thank you very much, this fixed my issue!

Seems like the default repos on Ubuntu 20.04 only provide cmake 3.18. Adding the cmake ppa manually and installing cmake from there gave me the latest version.

Almamu commented 1 year ago

I was not aware of this issue actually! Didn't get to read it before it got closed! I'm re-openning this to properly address it.

ghost commented 1 year ago

Hi, this issue is still happening with latest source and I am unable to update my cmake to a higher version.

fxy1699 commented 1 month ago

Did you add path to ~/.bashrc? I meet the same problem and this does help