Move googletest version variable into external CMake file and include in subsequent projects

Fixes #4309
This commit is contained in:
Tobias Markus 2024-05-14 08:59:10 +02:00
parent 33af80a883
commit efc0464ff4
4 changed files with 11 additions and 1 deletions

View File

@ -4,7 +4,9 @@
cmake_minimum_required(VERSION 3.13)
project(googletest-distribution)
set(GOOGLETEST_VERSION 1.14.0)
# Import googletest version
include(cmake/googletest-version.cmake)
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
set(CMAKE_CXX_EXTENSIONS OFF)

View File

@ -0,0 +1 @@
set(GOOGLETEST_VERSION 1.14.0)

View File

@ -8,6 +8,9 @@
# ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'.
# Import googletest version
include(../cmake/googletest-version.cmake)
option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
# A directory to find Google Test sources.

View File

@ -10,6 +10,10 @@
# When other libraries are using a shared version of runtime libraries,
# Google Test also has to use one.
# Import googletest version
include(../cmake/googletest-version.cmake)
option(
gtest_force_shared_crt
"Use shared (DLL) run-time lib even when Google Test is built as static lib."