# Source https://github.com/google/googletest/blob/master/googletest/README.md
cmake_minimum_required(VERSION 3.16)

project(googletest-download NONE)

# Cf https://cmake.org/cmake/help/latest/policy/CMP0135.html
if(POLICY CMP0135)
  cmake_policy(SET CMP0135 NEW)
endif()

include(ExternalProject)
ExternalProject_Add(googletest
  URL https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz
  URL_HASH SHA1=568d58e26bd4e838449ca7ab8ebc152b3cbd210d
  DOWNLOAD_NO_PROGRESS ON
  SOURCE_DIR        "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
  BINARY_DIR        "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
  CONFIGURE_COMMAND ""
  BUILD_COMMAND     ""
  TEST_COMMAND      ""
  # Disable install step
  INSTALL_COMMAND   ""
)
