summaryrefslogtreecommitdiffstats
path: root/docs/pkgconfig.md
diff options
context:
space:
mode:
authorCopybara-Service <copybara-worker@google.com>2023-06-20 15:20:43 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-06-20 15:20:43 (GMT)
commit29836977ef1c664588daeb035591c18a912e7c50 (patch)
tree213bfae7d42f084d4d3b44fb3c1c916514d69812 /docs/pkgconfig.md
parent6c088164163ea07406d07d34acaa29ede0b55cf2 (diff)
parent4fed5f285030085b096c930ff03e42c7814739b2 (diff)
downloadgoogletest-29836977ef1c664588daeb035591c18a912e7c50.zip
googletest-29836977ef1c664588daeb035591c18a912e7c50.tar.gz
googletest-29836977ef1c664588daeb035591c18a912e7c50.tar.bz2
Merge pull request #4288 from juan-lunarg:juan/cmake_min_3_dot_6
PiperOrigin-RevId: 541929012 Change-Id: I90423820611c2b6a6f81fe3f9ec2d23992ffbed1
Diffstat (limited to 'docs/pkgconfig.md')
-rw-r--r--docs/pkgconfig.md14
1 files changed, 5 insertions, 9 deletions
diff --git a/docs/pkgconfig.md b/docs/pkgconfig.md
index 18a2546..bf05d59 100644
--- a/docs/pkgconfig.md
+++ b/docs/pkgconfig.md
@@ -19,19 +19,15 @@ examples here we assume you want to compile the sample
Using `pkg-config` in CMake is fairly easy:
```cmake
-cmake_minimum_required(VERSION 3.0)
-
-cmake_policy(SET CMP0048 NEW)
-project(my_gtest_pkgconfig VERSION 0.0.1 LANGUAGES CXX)
-
find_package(PkgConfig)
pkg_search_module(GTEST REQUIRED gtest_main)
-add_executable(testapp samples/sample3_unittest.cc)
-target_link_libraries(testapp ${GTEST_LDFLAGS})
-target_compile_options(testapp PUBLIC ${GTEST_CFLAGS})
+add_executable(testapp)
+target_sources(testapp PRIVATE samples/sample3_unittest.cc)
+target_link_libraries(testapp PRIVATE ${GTEST_LDFLAGS})
+target_compile_options(testapp PRIVATE ${GTEST_CFLAGS})
-include(CTest)
+enable_testing()
add_test(first_and_only_test testapp)
```