aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-12-11 12:09:38 +0100
committerAndy Shaw <andy.shaw@qt.io>2018-12-17 13:28:56 +0000
commiteb1f9c2e687002643ebc80e51d4bfc5f0258da0d (patch)
tree14d7b5d121865eb0b2a7e32e446946cf0a691f38 /tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in
parent12f89fb8dda86c61277e3814912013873b1657e6 (diff)
CMake: Don't handle empty resource files
[ChangeLog][Qml] Empty resource files will not be passed to Qt Quick Compiler to be handled when using CMake. Change-Id: I1513d29b70d8a4b08a2947f4a97fbd525c5ace8f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in')
-rw-r--r--tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in22
1 files changed, 12 insertions, 10 deletions
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})