cmake: generate and install pkgconfig files

many packages expect packageconfig support especially for detecting EGL
libraries. This patch helps in compiling those packages on RPi

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2015-08-09 23:59:32 -07:00
committed by popcornmix
parent 1eac015380
commit 05d60a01d5
5 changed files with 55 additions and 1 deletions

View File

@@ -113,6 +113,14 @@ set(vmcs_host_apps_VERSION_MAJOR 1)
set(vmcs_host_apps_VERSION_MINOR 0)
include_directories("${PROJECT_BINARY_DIR}")
include(FindPkgConfig QUIET)
if(PKG_CONFIG_FOUND)
# Produce a pkg-config file
foreach(PCFILE bcm_host.pc egl.pc glesv2.pc vg.pc)
configure_file("pkgconfig/${PCFILE}.in" "${PCFILE}" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PCFILE}"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
endforeach()
endif()
# Remove cache entry, if one added by command line
unset(KHRONOS_EGL_PLATFORM CACHE)

10
pkgconfig/bcm_host.pc.in Normal file
View File

@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: bcm_host
Description: Broadcom VideoCore host API library
Version: 1
Libs: -L${libdir} -lbcm_host -lvcos -lvchiq_arm -pthread
Cflags: -I${includedir} -I${includedir}/interface/vmcs_host/linux -I${includedir}/interface/vcos/pthreads -DUSE_VCHIQ_ARM

13
pkgconfig/egl.pc.in Normal file
View File

@@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: EGL
Description: Fake EGL package for RPi
Version: 10
Requires: bcm_host
Libs: -L${libdir} -lEGL -lGLESv2 -lbcm_host -lvchostif
Cflags: -I${includedir} -I${includedir}/interface/vmcs_host/linux \
-I${includedir}/interface/vcos/pthreads

12
pkgconfig/glesv2.pc.in Normal file
View File

@@ -0,0 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: GLESv2
Description: Fake GL ES 2 package for RPi
Version: 10
Requires: bcm_host
Libs: -L${libdir} -lGLESv2
Cflags: -I${includedir}

11
pkgconfig/vg.pc.in Normal file
View File

@@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: OpenVG
Description: Fake OpenVG package for RPi
Version: 10
Requires: bcm_host
Libs: -L${libdir} -lOpenVG
Cflags: -I${includedir}