From 6ef1b60b08c1e232c84550eba88086d55609478c Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Fri, 9 Aug 2019 15:09:39 +0200 Subject: [PATCH] Fix QuickCompiler Setup Errors If the variable resource_files existed in the parent scope, the list would now be duplicate. Fix case where TO_CMAKE_PATH didn't properly convert //Foo into /Foo, so wee need to handle this manually. Change-Id: I73f1b4db82f6a80ba00da928b39091ac6c968a02 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index e14d7c13917..490df892899 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2411,6 +2411,7 @@ function(qt_quick_compiler_process_resources target resource_name) ) set(qml_files) + set(resource_files) # scan for qml files foreach(file IN LISTS arg_FILES) # check whether this resource should not be processed by the qt quick @@ -2444,7 +2445,12 @@ function(qt_quick_compiler_process_resources target resource_name) get_filename_component(file_absolute ${file} ABSOLUTE) file(RELATIVE_PATH file_relative ${CMAKE_CURRENT_SOURCE_DIR} ${file_absolute}) qt_get_relative_resource_path_for_file(file_resource_path ${file}) - set(file_resource_path "${arg_PREFIX}/${file_resource_path}") + if (arg_PREFIX STREQUAL "/") + # TO_CMAKE_PATH does not clean up cases such as //Foo + set(file_resource_path "/${file_resource_path}") + else() + set(file_resource_path "${arg_PREFIX}/${file_resource_path}") + endif() file(TO_CMAKE_PATH ${file_resource_path} file_resource_path) list(APPEND file_resource_paths ${file_resource_path}) string(REGEX REPLACE "\.js$" "_js" compiled_file ${file_relative})