FetchContent: CMake 3.27.0 no longer tolerates missing DOWNLOAD_EXTRACT_TIMESTAMP value
I have asked about this on Discourse, but I emailed Kitware about the PPA and your guy asked me to post the issue here.
I have been using the GTest instructions to use CMake to get it and build it for the past couple of years:
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)
With CMake 3.27.0, I get these messages:
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)
I have been unable to find an obvious cause in the 3.27.0 changelog and manual.
Edited by Brad King