[Beignet] [PATCH] generate pkg-config file
Lu Guanqun
guanqun.lu at intel.com
Wed Oct 16 22:29:26 PDT 2013
This would ease the configuration for other automake based softwares.
Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
---
CMakeLists.txt | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d18f50..e5de0b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,3 +146,23 @@ ADD_SUBDIRECTORY(backend)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(utests)
+# create pkg-config file
+function(create_pkgconfig_file OUT_FILE)
+ file(WRITE ${OUT_FILE} "")
+
+ file(APPEND ${OUT_FILE} "prefix=${CMAKE_INSTALL_PREFIX}\n")
+ file(APPEND ${OUT_FILE} "exec_prefix=\${prefix}\n")
+ file(APPEND ${OUT_FILE} "libdir=\${prefix}/lib\n")
+ file(APPEND ${OUT_FILE} "includedir=\${prefix}/include\n")
+ file(APPEND ${OUT_FILE} "\n")
+ file(APPEND ${OUT_FILE} "Name: Beignet\n")
+ file(APPEND ${OUT_FILE} "Description: OpenCL for Intel Platform (Support OpenCL ${LIBCL_C_VERSION_MAJOR}.${LIBCL_C_VERSION_MINOR})\n")
+ file(APPEND ${OUT_FILE} "Version: ${LIBCL_DRIVER_VERSION_MAJOR}.${LIBCL_DRIVER_VERSION_MINOR}\n")
+ file(APPEND ${OUT_FILE} "Libs: -L\${libdir} -lcl\n")
+ file(APPEND ${OUT_FILE} "Cflags: -I\${includedir}\n")
+
+endfunction()
+
+create_pkgconfig_file(libcl.pc)
+
+install(FILES libcl.pc DESTINATION /usr/share/pkgconfig)
More information about the Beignet
mailing list