Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 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 |
| 5 | 1.7.0 |
| 6 | |
| 7 | Signed-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 | |
| 14 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 15 | index 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 | # |
| 38 | diff --git a/gtest.pc.in b/gtest.pc.in |
| 39 | new file mode 100644 |
| 40 | index 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 | -- |
| 54 | 1.9.1 |
| 55 | |