1 From d4b25ce723812faf78d8ee038b7cbed00cbba682 Mon Sep 17 00:00:00 2001
2 From: Rodrigo Caimi <caimi@datacom.ind.br>
3 Date: Tue, 7 Oct 2014 15:37:10 -0300
4 Subject: [PATCH] CMakeLists, gtest.pc.in: Add pkg-config support to gtest
7 Signed-off-by: Rodrigo Caimi <caimi@datacom.ind.br>
9 CMakeLists.txt | 6 ++++++
10 gtest.pc.in | 9 +++++++++
11 2 files changed, 15 insertions(+)
12 create mode 100644 gtest.pc.in
14 diff --git a/CMakeLists.txt b/CMakeLists.txt
15 index 281c4c2..e4354a8 100644
18 @@ -29,6 +29,9 @@ if (COMMAND pre_project_set_up_hermetic_build)
19 pre_project_set_up_hermetic_build()
23 +configure_file("gtest.pc.in" "gtest.pc" @ONLY)
25 ########################################################################
27 # Project-wide settings
28 @@ -75,6 +78,9 @@ target_link_libraries(gtest_main gtest)
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/"
36 ########################################################################
38 diff --git a/gtest.pc.in b/gtest.pc.in
40 index 0000000..57b1049
46 +Description: Google's framework for writing C++ tests on a variety of platforms
48 +prefix=@CMAKE_INSTALL_PREFIX@
49 +includedir=${prefix}/include
51 +Cflags:-I${includedir}/gtest
52 +Libs: -L${libdir} -lgtest -lgtest_main