aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test/gtest/gtest/0002-CMakeLists-gtest.pc.in-Add-pkg-config-support-to-gte.patch
blob: 7a19f726f192ea5490e4efc1a8ceecad48757547 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 89639e76d5ee039a55004e5e910d565e6e84ed35 Mon Sep 17 00:00:00 2001
From: Rodrigo Caimi <caimi@datacom.ind.br>
Date: Tue, 7 Oct 2014 15:37:10 -0300
Subject: [PATCH 2/2] CMakeLists, gtest.pc.in: Add pkg-config support to gtest
 1.7.0

Signed-off-by: Rodrigo Caimi <caimi@datacom.ind.br>
---
 CMakeLists.txt | 6 ++++++
 gtest.pc.in    | 9 +++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 gtest.pc.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e969648..0038826 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,9 @@ if (COMMAND pre_project_set_up_hermetic_build)
   pre_project_set_up_hermetic_build()
 endif()
 
+# pkg-config support
+configure_file("gtest.pc.in" "gtest.pc" @ONLY)
+
 ########################################################################
 #
 # Project-wide settings
@@ -78,6 +81,9 @@ install(TARGETS gtest gtest_main
   DESTINATION ${CMAKE_INSTALL_LIBDIR})
 install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gtest.pc"
+    DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/"
+)
 
 ########################################################################
 #
diff --git a/gtest.pc.in b/gtest.pc.in
new file mode 100644
index 0000000..52e622b
--- /dev/null
+++ b/gtest.pc.in
@@ -0,0 +1,9 @@
+Name: libgtest
+Version: 1.7.0
+Description: Google's framework for writing C++ tests on a variety of platforms
+
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
+libdir=@CMAKE_INSTALL_LIBDIR@
+Cflags:-I${includedir}/gtest
+Libs: -L${libdir} -lgtest -lgtest_main
-- 
2.5.0