Skip to content

Commit

Permalink
Add pkgconfig file (#301)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam x Nilsson <adamni@axis.com>
  • Loading branch information
johanadamnilsson and Adam x Nilsson authored Nov 7, 2023
1 parent 5a5b4a1 commit 451e659
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target_include_directories(lv_drivers SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

find_package(PkgConfig)
pkg_check_modules(PKG_WAYLAND wayland-client wayland-cursor wayland-protocols xkbcommon)
pkg_check_modules(PKG_LVGL lvgl)
target_link_libraries(lv_drivers PUBLIC lvgl ${PKG_WAYLAND_LIBRARIES})

if("${LIB_INSTALL_DIR}" STREQUAL "")
Expand All @@ -38,7 +39,16 @@ install(
PATTERN ".git*" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
PATTERN "docs" EXCLUDE
PATTERN "lib" EXCLUDE)
PATTERN "lib" EXCLUDE
PATTERN "*.pc.in" EXCLUDE)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PKG_LVGL_CFLAGS}")

configure_file("${CMAKE_SOURCE_DIR}/lv-drivers.pc.in" lv-drivers.pc @ONLY)

install(
FILES "${CMAKE_BINARY_DIR}/lv-drivers.pc"
DESTINATION "${LIB_INSTALL_DIR}/pkgconfig/")

file(GLOB LV_DRIVERS_PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/lv_drv_conf.h")

Expand Down
11 changes: 11 additions & 0 deletions lv-drivers.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix="@CMAKE_INSTALL_PREFIX@"
includedir="${prefix}/@INC_INSTALL_DIR@"
libdir=${prefix}/lib

Name: lv-drivers
Description: Display controller and touchpad driver that can be directly used with LVGL
URL: https://lvgl.io/
Version: 9.0.0
Cflags: -I${includedir}
Libs: -L${libdir} -llv_drivers
Requires: lvgl

0 comments on commit 451e659

Please sign in to comment.