# GTest broken by CMake 3.27, I think

**URL:** <https://discourse.cmake.org/t/gtest-broken-by-cmake-3-27-i-think/8563>\
**Category:** Code\
**Created:** [July 20, 2023, 1:11pm UTC](https://discourse.cmake.org/t/gtest-broken-by-cmake-3-27-i-think/8563 "2023-07-20T13:11:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwrwseu](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jwrwseu](https://discourse.cmake.org/u/jwrwseu)\
**Post date:** [July 20, 2023, 1:11pm UTC](https://discourse.cmake.org/t/gtest-broken-by-cmake-3-27-i-think/8563/1 "2023-07-20T13:11:23Z")

</div>

I have been using the [GTest instructions](https://google.github.io/googletest/quickstart-cmake.html) to use CMake to get it and build it for the past couple of years:

```auto
    include(FetchContent)
    FetchContent_Declare(
      googletest
      DOWNLOAD_EXTRACT_TIMESTAMP
      URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
    )

    # For Windows: Prevent overriding the parent project's compiler/linker settings
    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
    FetchContent_MakeAvailable(googletest)

    enable_testing()
    include(GoogleTest)

```

Apart from the addition of `DOWNLOAD_EXTRACT_TIMESTAMP`, this has worked fine. Now, however, I am getting these messages:

```auto
No download info given for 'googletest-populate' and its source directory:

   /path/to/.build/_deps/googletest-src

  is not an existing non-empty directory. Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/share/cmake-3.27/Modules/ExternalProject.cmake:4345 (_ep_add_download_command)
  CMakeLists.txt:21 (ExternalProject_Add)

-- Configuring incomplete, errors occurred!

CMake Error at /usr/share/cmake-3.27/Modules/FetchContent.cmake:1650 (message):
  CMake step for googletest failed: 1
Call Stack (most recent call first):
  /usr/share/cmake-3.27/Modules/FetchContent.cmake:1802:EVAL:2 (__FetchContent_directPopulate)
  /usr/share/cmake-3.27/Modules/FetchContent.cmake:1802 (cmake_language)
  /usr/share/cmake-3.27/Modules/FetchContent.cmake:2016 (FetchContent_Populate)
  CMakeLists.txt:126 (FetchContent_MakeAvailable)

```

Can anyone shed light on this problem? The URL is already provided by `FetchContent_Declare()`, so why would I include this in the call to `FetchContent_MakeAvailable()`?

I have looked at the CMake documentation, but nothing seems to have been added to FetchContent in 3.27. I find the documentation very difficult to follow, however, so perhaps I am wrong.

**Additional: I have checked with 3.26.5 and this problem does not exist**

---

<div class="post-metadata">

**Author:** ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)\
**Post date:** [July 20, 2023, 4:35pm UTC](https://discourse.cmake.org/t/gtest-broken-by-cmake-3-27-i-think/8563/2 "2023-07-20T16:35:16Z")

</div>

For reference, this has now been reported as [CMake issue 25107](https://gitlab.kitware.com/cmake/cmake/-/issues/25107).
