diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f20d105002..8bbd49c03c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,42 +244,24 @@ endif() export_components("${CMAKE_BINARY_DIR}/components.ini") +# it seems like cmake cannot uncompress *.gz files... only ZIP/tar.gz. +# Lets download the uncompressed versions. +# https://gitlab.kitware.com/cmake/cmake/-/issues/23054 + set(PCI_IDS_FILE pci.ids) -set(PCI_IDS_GZ_URL https://pci-ids.ucw.cz/v2.2/${PCI_IDS_FILE}.gz) -set(PCI_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/${PCI_IDS_FILE}.gz) +set(PCI_IDS_URL https://pci-ids.ucw.cz/v2.2/${PCI_IDS_FILE}) set(PCI_IDS_PATH ${CMAKE_BINARY_DIR}/${PCI_IDS_FILE}) set(PCI_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/${PCI_IDS_FILE}) -if(ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS ${PCI_IDS_GZ_PATH}) - download_file("${PCI_IDS_GZ_URL}" "${PCI_IDS_GZ_PATH}") -endif() - -if(EXISTS ${PCI_IDS_GZ_PATH} AND NOT EXISTS ${CMAKE_STAGING_PREFIX}/${PCI_IDS_INSTALL_PATH}) - message(STATUS "Extracting PCI ID database from ${PCI_IDS_GZ_PATH}...") - file(MAKE_DIRECTORY "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}") - if (CMAKE_VERSION VERSION_LESS 3.18.0) - execute_process(COMMAND "${GZIP_TOOL}" -d -c "${PCI_IDS_GZ_PATH}" OUTPUT_FILE "${CMAKE_STAGING_PREFIX}/${PCI_IDS_INSTALL_PATH}") - else() - file(ARCHIVE_EXTRACT INPUT "${PCI_IDS_GZ_PATH}" DESTINATION "${PCI_IDS_GZ_PATH}" PATTERNS "${CMAKE_STAGING_PREFIX}/${PCI_IDS_INSTALL_PATH}") - endif() +if(ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS ${CMAKE_STAGING_PREFIX}/${PCI_IDS_INSTALL_PATH} ) + download_file("${PCI_IDS_URL}" "${CMAKE_STAGING_PREFIX}/${PCI_IDS_INSTALL_PATH}") endif() set(USB_IDS_FILE usb.ids) -set(USB_IDS_GZ_URL http://www.linux-usb.org/${USB_IDS_FILE}.gz) -set(USB_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/${USB_IDS_FILE}.gz) +set(USB_IDS_URL http://www.linux-usb.org/${USB_IDS_FILE}) set(USB_IDS_PATH ${CMAKE_BINARY_DIR}/${USB_IDS_FILE}) set(USB_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/${USB_IDS_FILE}) -if(ENABLE_USB_IDS_DOWNLOAD AND NOT EXISTS ${USB_IDS_GZ_PATH}) - download_file("${USB_IDS_GZ_URL}" "${USB_IDS_GZ_PATH}") -endif() - -if(EXISTS ${USB_IDS_GZ_PATH} AND NOT EXISTS ${CMAKE_STAGING_PREFIX}/${USB_IDS_INSTALL_PATH}) - message(STATUS "Extracting USB ID database from ${USB_IDS_GZ_PATH}...") - file(MAKE_DIRECTORY "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}") - if (CMAKE_VERSION VERSION_LESS 3.18.0) - execute_process(COMMAND "${GZIP_TOOL}" -d -c "${USB_IDS_GZ_PATH}" OUTPUT_FILE "${CMAKE_STAGING_PREFIX}/${USB_IDS_INSTALL_PATH}") - else() - file(ARCHIVE_EXTRACT INPUT "${PCI_IDS_GZ_PATH}" DESTINATION "${USB_IDS_GZ_PATH}" PATTERNS "${CMAKE_STAGING_PREFIX}/${USB_IDS_INSTALL_PATH}") - endif() +if(ENABLE_USB_IDS_DOWNLOAD AND NOT EXISTS "${CMAKE_STAGING_PREFIX}/${USB_IDS_PATH}") + download_file("${USB_IDS_URL}" "${CMAKE_STAGING_PREFIX}/${USB_IDS_PATH}") endif()