1From df6111570ada81d3968043decb5eee16dc5f9fa1 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sun, 7 Feb 2021 01:30:39 +0000
4Subject: [PATCH] generate glslang pkg-config
5
6Based on https://src.fedoraproject.org/rpms/glslang/blob/main/f/0001-pkg-config-compatibility.patch
7
8Upstream-Status: Inappropriate [independently developed patch submitted at https://github.com/KhronosGroup/glslang/pull/3371]
9
10Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
11---
12 glslang/CMakeLists.txt      |  2 ++
13 glslang/glslang.pc.cmake.in | 11 +++++++++++
14 2 files changed, 13 insertions(+)
15 create mode 100644 glslang/glslang.pc.cmake.in
16
17diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
18index 47925d8d..d90191c3 100644
19--- a/glslang/CMakeLists.txt
20+++ b/glslang/CMakeLists.txt
21@@ -255,6 +255,8 @@ if(GLSLANG_ENABLE_INSTALL)
22         install(TARGETS MachineIndependent EXPORT glslang-targets)
23         install(TARGETS GenericCodeGen EXPORT glslang-targets)
24     endif()
25+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/glslang.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc @ONLY)
26+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
27
28     set(PUBLIC_HEADERS
29         Public/ResourceLimits.h
30diff --git a/glslang/glslang.pc.cmake.in b/glslang/glslang.pc.cmake.in
31new file mode 100644
32index 00000000..43104e68
33--- /dev/null
34+++ b/glslang/glslang.pc.cmake.in
35@@ -0,0 +1,11 @@
36+prefix=@CMAKE_INSTALL_PREFIX@
37+exec_prefix=@CMAKE_INSTALL_PREFIX@
38+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
39+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
40+
41+Name: @PROJECT_NAME@
42+Description: OpenGL and OpenGL ES shader front end and validator
43+Requires:
44+Version: @GLSLANG_VERSION@
45+Libs: -L${libdir} -lglslang -lHLSL -lSPVRemapper
46+Cflags: -I${includedir}
47