file(ARCHIVE_EXTRACT...) doesn't extract gzip files
Using the following CMakeLists.txt
, I get a CMake Error: Problem with archive_read_open_file(): Unrecognized archive format
when attempting to extract a gzip file. Creating gzip files works fine, it's only the extraction which doesn't seem to work. Is this the intended behavior?
Spotted over on: https://github.com/SerenityOS/serenity/issues/9866
cmake_minimum_required(VERSION 3.18)
project(Whatever)
set(PCI_IDS_GZ_URL https://pci-ids.ucw.cz/v2.2/pci.ids.gz)
set(PCI_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/pci.ids.gz)
set(PCI_IDS_PATH ${CMAKE_BINARY_DIR}/pci.ids)
set(PCI_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/pci.ids)
file(DOWNLOAD ${PCI_IDS_GZ_URL} ${PCI_IDS_GZ_PATH} INACTIVITY_TIMEOUT 10)
file(ARCHIVE_EXTRACT INPUT ${PCI_IDS_GZ_PATH})