From 656528f483f6d6bda3d17f035f5690b18b960f2a Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 10 Jul 2022 15:50:02 +0200 Subject: [PATCH] Meta: Prefix manually created directories with the staging prefix In commit 02e8f2956014bd17c4e5a68757776fffc6d43c51 we started exporting the `CMAKE_INSTALL_*DIR` variables without prefix in order to make better use of the actual `PREFIX` settings. However, commands like `file(MAKE_DIRECTORY ...)` don't understand the GNUInstallDirs way of building paths, so we ended up creating directories in our main project directory by accident. Fix that by manually adding the correct prefix onto the path. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a0f7943194..0392cbc06ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,7 +253,7 @@ endif() if(EXISTS ${PCI_IDS_GZ_PATH} AND NOT EXISTS ${PCI_IDS_INSTALL_PATH}) message(STATUS "Extracting PCI ID database from ${PCI_IDS_GZ_PATH}...") - file(MAKE_DIRECTORY ${CMAKE_INSTALL_DATAROOTDIR}) + file(MAKE_DIRECTORY "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}") execute_process(COMMAND "${GZIP_TOOL}" -d -c "${PCI_IDS_GZ_PATH}" OUTPUT_FILE "${PCI_IDS_INSTALL_PATH}") endif() @@ -269,6 +269,6 @@ endif() if(EXISTS ${USB_IDS_GZ_PATH} AND NOT EXISTS ${USB_IDS_INSTALL_PATH}) message(STATUS "Extracting USB ID database from ${USB_IDS_GZ_PATH}...") - file(MAKE_DIRECTORY ${CMAKE_INSTALL_DATAROOTDIR}) + file(MAKE_DIRECTORY "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}") execute_process(COMMAND "${GZIP_TOOL}" -d -c "${USB_IDS_GZ_PATH}" OUTPUT_FILE "${USB_IDS_INSTALL_PATH}") endif()