Handle CMake 3.24's introduction of CMP0135

cmake 3.24 introduces a new fetchcontent property relating to timestmaps,
but using the new keyword would require forcing cmake 3.24 on people
(which we don't want to do). instead we can just tell cmake to use the
new behavior when possible by enabling CMP0135
pull/247/head
Oliver Smith 2 years ago
parent 9c093a802b
commit 98bb00859f
  1. 6
      test/CMakeLists.txt

@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.14)
project(test)
if(POLICY CMP0135)
# CMake Policy 0135 cares about how fetchcontent handles timestamps, and we
# want the new behavior (use extraction timestamps) when possible.
cmake_policy(SET CMP0135 NEW)
endif()
include(FetchContent)
FetchContent_Declare(
googletest

Loading…
Cancel
Save