Meta: Make sure directories for pci.ids and usb.ids exist

`file(COPY_FILE ...)` fails if the target directory does not already
exist, whereas `install(FILES ... DESTINATION ...)` happily creates all
the required directories.
This commit is contained in:
Sam Atkins 2023-03-15 15:50:57 +00:00 committed by Tim Flynn
parent b18c1c7291
commit 1e36d54493
Notes: sideshowbarker 2024-07-17 18:46:30 +09:00

View file

@ -252,7 +252,7 @@ set(PCI_IDS_INSTALL_PATH "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/$
if (ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS "${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}") download_file("${PCI_IDS_URL}" "${PCI_IDS_DOWNLOAD_PATH}")
file(COPY_FILE "${PCI_IDS_DOWNLOAD_PATH}" "${PCI_IDS_INSTALL_PATH}") install(FILES "${PCI_IDS_DOWNLOAD_PATH}" DESTINATION "${PCI_IDS_INSTALL_PATH}")
endif() endif()
set(USB_IDS_FILE usb.ids) set(USB_IDS_FILE usb.ids)
@ -262,5 +262,5 @@ set(USB_IDS_INSTALL_PATH "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/$
if (ENABLE_USB_IDS_DOWNLOAD AND NOT EXISTS "${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}") download_file("${USB_IDS_URL}" "${USB_IDS_DOWNLOAD_PATH}")
file(COPY_FILE "${USB_IDS_DOWNLOAD_PATH}" "${USB_IDS_INSTALL_PATH}") install(FILES "${USB_IDS_DOWNLOAD_PATH}" DESTINATION "${USB_IDS_INSTALL_PATH}")
endif() endif()