lvgl / lv_port_linux

LVGL configured to work with a standard Linux framebuffer
MIT License
235 stars 148 forks source link

SDL2、Libdrm_LIBRARY #50

Open Lennox7746 opened 3 months ago

Lennox7746 commented 3 months ago

I have encountered some issues. I want to use hdmi to display lvgl images on my Linux development board, but when trying to create a cmake file, I keep getting the following error message. May I ask what SDL2 and Libdrm.LIBRARY are?

The error is as follows

zyc@zyc-desktop-ubuntu22:~/code/lvgl_v9_linux/build$ cmake ..
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for modules 'pkg_check_modules;libdrm'
--   No package 'pkg_check_modules' found
-- Could NOT find Libdrm (missing: Libdrm_LIBRARY) 
CMake Warning at CMakeLists.txt:26 (find_package):
  By not providing "FindSDL2_image.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "SDL2_image", but CMake did not find one.

  Could not find a package configuration file provided by "SDL2_image" with
  any of the following names:

    SDL2_imageConfig.cmake
    sdl2_image-config.cmake

  Add the installation prefix of "SDL2_image" to CMAKE_PREFIX_PATH or set
  "SDL2_image_DIR" to a directory containing one of the above files.  If
  "SDL2_image" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Libdrm_LIBRARY (ADVANCED)
    linked by target "main" in directory /home/zyc/code/lvgl_v9_linux

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
kisvegabor commented 3 months ago

Hi,

I have 2 questions:

badevos commented 3 months ago

I had the same issue, yet this seems to be fixed using the following: https://stackoverflow.com/questions/52813560/i-have-libsdl2-image-dev-installed-via-apt-get-but-cmake-cannot-find-it

I'm working on Ubuntu 22.04

YobeZhou commented 2 months ago

I'm ok on Ubuntu 18.04:

ubuntu@ubuntu1804:~/work/lv_port_linux/build$ sudo apt-get install libsdl2-2.0 libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-gfx-dev -y
ubuntu@ubuntu1804:~/work/lv_port_linux/build$ cmake -version
cmake version 3.30.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
ubuntu@ubuntu1804:~/work/lv_port_linux/build$
jiangliu123456 commented 4 weeks ago

ubuntu 16.04

用下面两行替换find_package(SDL2_image) find_library(NAME SDL2_image REQUIRED) link_libraries(SDL2_image)

kisvegabor commented 4 weeks ago

It should be fixed in LVGL v9.2.