From 1b7f1aad4022abd9322acb1c1b218f9a07926db3 Mon Sep 17 00:00:00 2001 From: Niclas Rosenvik Date: Fri, 9 Apr 2021 07:13:50 +0000 Subject: [PATCH] Fix generating mimedatabase with generate.pl using make When building using make and having set QT_AVOID_CMAKE_ARCHIVING_API to ON the build breaks with the message "sh: cannot create .rcc/qmimeprovider_database.cpp: directory nonexistent" . ninja creates this directory automatically, make does not. Add a file MAKE_DIRECTORY cmake command to make sure the .rcc directory is created. Change-Id: I140279a794753436d427d647ab2231636827d07f Reviewed-by: Alexandru Croitor --- src/corelib/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 467827b1c6..3b4fdd1b46 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1159,7 +1159,8 @@ if(QT_FEATURE_mimetype AND QT_FEATURE_mimetype_database) include(${CMAKE_CURRENT_SOURCE_DIR}/mimetypes/mimetypes_resources.cmake) # Generate qmimeprovider_database.cpp - set(qmimeprovider_db_output "${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmimeprovider_database.cpp") + set(qmimeprovider_db_output_dir "${CMAKE_CURRENT_BINARY_DIR}/.rcc") + set(qmimeprovider_db_output "${qmimeprovider_db_output_dir}/qmimeprovider_database.cpp") if(CMAKE_VERSION VERSION_LESS 3.18 OR QT_AVOID_CMAKE_ARCHIVING_API) set(command_args "") set(mime_dir "${CMAKE_CURRENT_SOURCE_DIR}/mimetypes/mime") @@ -1168,6 +1169,7 @@ if(QT_FEATURE_mimetype AND QT_FEATURE_mimetype_database) list(APPEND command_args "${mime_dir}/generate.bat") list(APPEND command_depends "${mime_dir}/generate.bat" "${mime_dir}/hexdump.ps1" ) else() + file(MAKE_DIRECTORY ${qmimeprovider_db_output_dir}) list(APPEND command_args perl "${mime_dir}/generate.pl" ) endif()