summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test
diff options
context:
space:
mode:
authorMario Domenech Goulart <mario@ossystems.com.br>2014-10-30 11:10:45 -0200
committerMartin Jansa <Martin.Jansa@gmail.com>2014-11-19 15:19:25 +0100
commitff5cda05c9caa0a1c8fc47e8ad5898acb7755399 (patch)
treef692032647e97a30f6070f45294492ee0d477e01 /meta-oe/recipes-test
parent23d22879835e1a0fa2f81bf5a6b63bdb09210f14 (diff)
downloadmeta-openembedded-ff5cda05c9caa0a1c8fc47e8ad5898acb7755399.tar.gz
gtest: add recipe
gtest is a framework for writing C++ tests, by Google. Signed-off-by: Mario Domenech Goulart <mario@ossystems.com.br> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-test')
-rw-r--r--meta-oe/recipes-test/gtest/gtest/CMakeLists-gtest.pc.in-Add-pkg-config-support-to-gte.patch55
-rw-r--r--meta-oe/recipes-test/gtest/gtest/cmake-Add-install-command-for-libraries-and-headers.patch39
-rw-r--r--meta-oe/recipes-test/gtest/gtest_1.7.0.bb23
3 files changed, 117 insertions, 0 deletions
diff --git a/meta-oe/recipes-test/gtest/gtest/CMakeLists-gtest.pc.in-Add-pkg-config-support-to-gte.patch b/meta-oe/recipes-test/gtest/gtest/CMakeLists-gtest.pc.in-Add-pkg-config-support-to-gte.patch
new file mode 100644
index 000000000..1ece136b6
--- /dev/null
+++ b/meta-oe/recipes-test/gtest/gtest/CMakeLists-gtest.pc.in-Add-pkg-config-support-to-gte.patch
@@ -0,0 +1,55 @@
1From d4b25ce723812faf78d8ee038b7cbed00cbba682 Mon Sep 17 00:00:00 2001
2From: Rodrigo Caimi <caimi@datacom.ind.br>
3Date: Tue, 7 Oct 2014 15:37:10 -0300
4Subject: [PATCH] CMakeLists, gtest.pc.in: Add pkg-config support to gtest
5 1.7.0
6
7Signed-off-by: Rodrigo Caimi <caimi@datacom.ind.br>
8---
9 CMakeLists.txt | 6 ++++++
10 gtest.pc.in | 9 +++++++++
11 2 files changed, 15 insertions(+)
12 create mode 100644 gtest.pc.in
13
14diff --git a/CMakeLists.txt b/CMakeLists.txt
15index 281c4c2..e4354a8 100644
16--- a/CMakeLists.txt
17+++ b/CMakeLists.txt
18@@ -29,6 +29,9 @@ if (COMMAND pre_project_set_up_hermetic_build)
19 pre_project_set_up_hermetic_build()
20 endif()
21
22+# pkg-config support
23+configure_file("gtest.pc.in" "gtest.pc" @ONLY)
24+
25 ########################################################################
26 #
27 # Project-wide settings
28@@ -75,6 +78,9 @@ target_link_libraries(gtest_main gtest)
29
30 install(TARGETS gtest DESTINATION lib)
31 install(TARGETS gtest_main DESTINATION lib)
32+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gtest.pc"
33+ DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/"
34+)
35
36 ########################################################################
37 #
38diff --git a/gtest.pc.in b/gtest.pc.in
39new file mode 100644
40index 0000000..57b1049
41--- /dev/null
42+++ b/gtest.pc.in
43@@ -0,0 +1,9 @@
44+Name: libgtest
45+Version: 1.7.0
46+Description: Google's framework for writing C++ tests on a variety of platforms
47+
48+prefix=@CMAKE_INSTALL_PREFIX@
49+includedir=${prefix}/include
50+libdir=${prefix}/lib
51+Cflags:-I${includedir}/gtest
52+Libs: -L${libdir} -lgtest -lgtest_main
53--
541.9.1
55
diff --git a/meta-oe/recipes-test/gtest/gtest/cmake-Add-install-command-for-libraries-and-headers.patch b/meta-oe/recipes-test/gtest/gtest/cmake-Add-install-command-for-libraries-and-headers.patch
new file mode 100644
index 000000000..0c160b02a
--- /dev/null
+++ b/meta-oe/recipes-test/gtest/gtest/cmake-Add-install-command-for-libraries-and-headers.patch
@@ -0,0 +1,39 @@
1From 5318983562be6babeb5a6996e7dda4b31acfdba8 Mon Sep 17 00:00:00 2001
2From: Otavio Salvador <otavio@ossystems.com.br>
3Date: Wed, 30 Jul 2014 16:49:53 -0300
4Subject: [PATCH] cmake: Add install command for libraries and headers
5Organization: O.S. Systems Software LTDA.
6
7Upstream-Status: Inappropriate [embedded specific]
8
9Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
10---
11 CMakeLists.txt | 5 +++++
12 1 file changed, 5 insertions(+)
13
14diff --git a/CMakeLists.txt b/CMakeLists.txt
15index 57470c8..281c4c2 100644
16--- a/CMakeLists.txt
17+++ b/CMakeLists.txt
18@@ -56,6 +56,8 @@ include_directories(
19 ${gtest_SOURCE_DIR}/include
20 ${gtest_SOURCE_DIR})
21
22+install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest DESTINATION include)
23+
24 # Where Google Test's libraries can be found.
25 link_directories(${gtest_BINARY_DIR}/src)
26
27@@ -71,6 +73,9 @@ cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
28 cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
29 target_link_libraries(gtest_main gtest)
30
31+install(TARGETS gtest DESTINATION lib)
32+install(TARGETS gtest_main DESTINATION lib)
33+
34 ########################################################################
35 #
36 # Samples on how to link user tests with gtest or gtest_main.
37--
381.9.1
39
diff --git a/meta-oe/recipes-test/gtest/gtest_1.7.0.bb b/meta-oe/recipes-test/gtest/gtest_1.7.0.bb
new file mode 100644
index 000000000..9f148d549
--- /dev/null
+++ b/meta-oe/recipes-test/gtest/gtest_1.7.0.bb
@@ -0,0 +1,23 @@
1DESCRIPTION = "Google's framework for writing C++ tests"
2HOMEPAGE = "http://code.google.com/p/googletest/"
3SECTION = "libs"
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=cbbd27594afd089daa160d3a16dd515a"
6
7SRC_URI = "\
8 http://googletest.googlecode.com/files/${BPN}-${PV}.zip \
9 file://cmake-Add-install-command-for-libraries-and-headers.patch \
10 file://CMakeLists-gtest.pc.in-Add-pkg-config-support-to-gte.patch \
11"
12
13SRC_URI[md5sum] = "2d6ec8ccdf5c46b05ba54a9fd1d130d7"
14SRC_URI[sha256sum] = "247ca18dd83f53deb1328be17e4b1be31514cedfc1e3424f672bf11fd7e0d60d"
15
16inherit lib_package cmake
17
18ALLOW_EMPTY_${PN} = "1"
19ALLOW_EMPTY_${PN}-dbg = "1"
20
21RDEPENDS_${PN}-dev += "${PN}-staticdev"
22
23BBCLASSEXTEND = "nativesdk"