aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJuan Ramos <juan@lunarg.com>2023-06-19 11:21:44 -0600
committerJuan Ramos <juan@lunarg.com>2023-06-19 11:21:44 -0600
commit4fed5f285030085b096c930ff03e42c7814739b2 (patch)
treeb8a353d09d606c22b3d2b5a88c6d844d02b99922 /docs
parent9b12f749fa972d08703d8459e9bf3239617491ca (diff)
downloadgoogletest-4fed5f285030085b096c930ff03e42c7814739b2.zip
googletest-4fed5f285030085b096c930ff03e42c7814739b2.tar.gz
googletest-4fed5f285030085b096c930ff03e42c7814739b2.tar.bz2
cmake: Raise min to 3.6
From the CMake 3.27 release notes: Compatibility with versions of CMake older than 3.5 is now deprecated and will be removed from a future version. Calls to cmake_minimum_required() or cmake_policy() that set the policy version to an older value now issue a deprecation diagnostic. This PR also removes manually setting policy CMP0048. This is redundant since the CMake min is already 3.X
Diffstat (limited to 'docs')
-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)
```