diff options
-rw-r--r-- | tests/auto/cmake/qtquickcompiler/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/auto/cmake/qtquickcompiler/empty.qrc | 0 | ||||
-rw-r--r-- | tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in | 22 |
3 files changed, 13 insertions, 11 deletions
diff --git a/tests/auto/cmake/qtquickcompiler/CMakeLists.txt b/tests/auto/cmake/qtquickcompiler/CMakeLists.txt index 4e46544767..9f8112ef49 100644 --- a/tests/auto/cmake/qtquickcompiler/CMakeLists.txt +++ b/tests/auto/cmake/qtquickcompiler/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(Qt5QuickCompiler) set(CMAKE_CXXFLAGS "${CMAKE_CXXFLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") -qtquick_compiler_add_resources(RESOURCES "resources with space/qqc_test.qrc") +qtquick_compiler_add_resources(RESOURCES "empty.qrc" "resources with space/qqc_test.qrc") set(CMAKE_AUTOMOC ON) diff --git a/tests/auto/cmake/qtquickcompiler/empty.qrc b/tests/auto/cmake/qtquickcompiler/empty.qrc new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/cmake/qtquickcompiler/empty.qrc diff --git a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in index a5c531fb0d..75fbb0fcf3 100644 --- a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in +++ b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in @@ -61,16 +61,18 @@ but not all the files it references. set(rcc_file_with_compilation_units) execute_process(COMMAND ${rcc_path} -list \"${input_resource}\" OUTPUT_VARIABLE rcc_contents) - string(REGEX REPLACE \"[\r\n]+\" \";\" rcc_contents ${rcc_contents}) - foreach(it ${rcc_contents}) - get_filename_component(extension ${it} EXT) - if(extension STREQUAL \".qml\" OR extension STREQUAL \".js\" OR extension STREQUAL \".ui.qml\" OR extension STREQUAL \".mjs\") - qtquick_compiler_determine_output_filename(output_file ${it}) - add_custom_command(OUTPUT ${output_file} COMMAND ${compiler_path} ARGS --resource=${input_resource} ${it} -o ${output_file} DEPENDS ${it}) - list(APPEND compiler_output ${output_file}) - set(rcc_file_with_compilation_units ${input_resource}) - endif() - endforeach() + if (NOT rcc_contents STREQUAL \"\") + string(REGEX REPLACE \"[\r\n]+\" \";\" rcc_contents ${rcc_contents}) + foreach(it ${rcc_contents}) + get_filename_component(extension ${it} EXT) + if(extension STREQUAL \".qml\" OR extension STREQUAL \".js\" OR extension STREQUAL \".ui.qml\" OR extension STREQUAL \".mjs\") + qtquick_compiler_determine_output_filename(output_file ${it}) + add_custom_command(OUTPUT ${output_file} COMMAND ${compiler_path} ARGS --resource=${input_resource} ${it} -o ${output_file} DEPENDS ${it}) + list(APPEND compiler_output ${output_file}) + set(rcc_file_with_compilation_units ${input_resource}) + endif() + endforeach() + endif() if(rcc_file_with_compilation_units) list(APPEND rcc_files_with_compilation_units ${rcc_file_with_compilation_units}) |