mirror of
https://github.com/google/googletest.git
synced 2024-12-27 10:11:03 +08:00
Merge pull request #4288 from juan-lunarg:juan/cmake_min_3_dot_6
PiperOrigin-RevId: 541929012 Change-Id: I90423820611c2b6a6f81fe3f9ec2d23992ffbed1
This commit is contained in:
commit
29836977ef
@ -1,11 +1,7 @@
|
|||||||
# Note: CMake support is community-based. The maintainers do not use CMake
|
# Note: CMake support is community-based. The maintainers do not use CMake
|
||||||
# internally.
|
# internally.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
if (POLICY CMP0048)
|
|
||||||
cmake_policy(SET CMP0048 NEW)
|
|
||||||
endif (POLICY CMP0048)
|
|
||||||
|
|
||||||
if (POLICY CMP0069)
|
if (POLICY CMP0069)
|
||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
|
@ -19,19 +19,15 @@ examples here we assume you want to compile the sample
|
|||||||
Using `pkg-config` in CMake is fairly easy:
|
Using `pkg-config` in CMake is fairly easy:
|
||||||
|
|
||||||
```cmake
|
```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)
|
find_package(PkgConfig)
|
||||||
pkg_search_module(GTEST REQUIRED gtest_main)
|
pkg_search_module(GTEST REQUIRED gtest_main)
|
||||||
|
|
||||||
add_executable(testapp samples/sample3_unittest.cc)
|
add_executable(testapp)
|
||||||
target_link_libraries(testapp ${GTEST_LDFLAGS})
|
target_sources(testapp PRIVATE samples/sample3_unittest.cc)
|
||||||
target_compile_options(testapp PUBLIC ${GTEST_CFLAGS})
|
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)
|
add_test(first_and_only_test testapp)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,8 +36,7 @@ endif()
|
|||||||
# as ${gmock_SOURCE_DIR} and to the root binary directory as
|
# as ${gmock_SOURCE_DIR} and to the root binary directory as
|
||||||
# ${gmock_BINARY_DIR}.
|
# ${gmock_BINARY_DIR}.
|
||||||
# Language "C" is required for find_package(Threads).
|
# Language "C" is required for find_package(Threads).
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
cmake_policy(SET CMP0048 NEW)
|
|
||||||
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
|
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
|
||||||
|
|
||||||
if (COMMAND set_up_hermetic_build)
|
if (COMMAND set_up_hermetic_build)
|
||||||
|
@ -46,8 +46,7 @@ endif()
|
|||||||
|
|
||||||
# Project version:
|
# Project version:
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
cmake_policy(SET CMP0048 NEW)
|
|
||||||
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
|
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
|
||||||
|
|
||||||
if (POLICY CMP0063) # Visibility
|
if (POLICY CMP0063) # Visibility
|
||||||
|
Loading…
x
Reference in New Issue
Block a user