Skip to content

FetchContent not respecting DOWNLOAD_NO_EXTRACT

Cmake 3.11.4

The FetchContent module does not seem to respect the ExternalProject_Add download option DOWNLOAD_NO_EXTRACT, despite claiming to understand all download and patch options.

For whatever reason whatever URL is passed ends up being downloaded as archive.tar in \tmp\json-populate-prefix\src, which is obviously invalid. The file is, besides it's name and extension, is otherwise downloaded correctly.

This leads to the following errors

CUSTOMBUILD : CMake error : Problem with archive_read_open_file(): Unrecognized archive format
CUSTOMBUILD : CMake error : Problem extracting tar: archive.tar
  -- extracting... [error clean up]
  CMake Error at tmp/json-populate-prefix/src/json-populate-stamp/extract-json-populate.cmake:33 (message):
CUSTOMBUILD : error : extract of [\tmp\json-populate.vcxproj]
    'tmp/json-populate-prefix/src/archive.tar'
    failed

    0 Warning(s)
    3 Error(s)

Time Elapsed 00:00:01.28

CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FetchContent.cmake:798 (message):
  Build step for json failed: 1
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.11/Modules/FetchContent.cmake:822 (__FetchContent_directPopulate)
  CMake/downloader.cmake:195 (FetchContent_Populate)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information