Skip to content

Commit

Permalink
Move googletest version variable into external CMake file and include…
Browse files Browse the repository at this point in the history
… in subsequent projects

Fixes google#4309
  • Loading branch information
tobbi committed May 14, 2024
1 parent 33af80a commit efc0464
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions cmake/googletest-version.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(GOOGLETEST_VERSION 1.14.0)
3 changes: 3 additions & 0 deletions googlemock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit efc0464

Please sign in to comment.