diff --git a/CMakeLists.txt b/CMakeLists.txt index f2543506e3e..3ff5a229bc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,17 +246,21 @@ export_components("${CMAKE_BINARY_DIR}/components.ini") # https://gitlab.kitware.com/cmake/cmake/-/issues/23054 set(PCI_IDS_FILE pci.ids) -set(PCI_IDS_URL https://pci-ids.ucw.cz/v2.2/${PCI_IDS_FILE}) -set(PCI_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/${PCI_IDS_FILE}) +set(PCI_IDS_URL "https://pci-ids.ucw.cz/v2.2/${PCI_IDS_FILE}") +set(PCI_IDS_DOWNLOAD_PATH "${SERENITY_CACHE_DIR}/${PCI_IDS_FILE}") +set(PCI_IDS_INSTALL_PATH "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/${PCI_IDS_FILE}") -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}") +if (ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS "${PCI_IDS_INSTALL_PATH}") + download_file("${PCI_IDS_URL}" "${PCI_IDS_DOWNLOAD_PATH}") + file(COPY_FILE "${PCI_IDS_DOWNLOAD_PATH}" "${PCI_IDS_INSTALL_PATH}") endif() set(USB_IDS_FILE usb.ids) -set(USB_IDS_URL http://www.linux-usb.org/${USB_IDS_FILE}) -set(USB_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/${USB_IDS_FILE}) +set(USB_IDS_URL "http://www.linux-usb.org/${USB_IDS_FILE}") +set(USB_IDS_DOWNLOAD_PATH "${SERENITY_CACHE_DIR}/${USB_IDS_FILE}") +set(USB_IDS_INSTALL_PATH "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/${USB_IDS_FILE}") -if(ENABLE_USB_IDS_DOWNLOAD AND NOT EXISTS "${CMAKE_STAGING_PREFIX}/${USB_IDS_INSTALL_PATH}") - download_file("${USB_IDS_URL}" "${CMAKE_STAGING_PREFIX}/${USB_IDS_INSTALL_PATH}") +if (ENABLE_USB_IDS_DOWNLOAD AND NOT EXISTS "${USB_IDS_INSTALL_PATH}") + download_file("${USB_IDS_URL}" "${USB_IDS_DOWNLOAD_PATH}") + file(COPY_FILE "${USB_IDS_DOWNLOAD_PATH}" "${USB_IDS_INSTALL_PATH}") endif()