summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2018-06-06 16:05:35 +0200
committerRolf Eike Beer <eb@emlix.com>2018-06-08 07:26:15 +0000
commit7f3204ea7ba7836907b2d3eeefc51912c1c8c54b (patch)
tree6d25c44c8efeb8bc29c0d18947a62d982d9bd591
parent8735ff6499f4ef93675a9e8158af77461f6e93bc (diff)
CMake: avoid x${var} tricks
Just passing the variable name to if() will make CMake evaluate it exactly once, without the need for any specific tricks. The x${var} tricks may be necessary for macro() arguments, which are not variables, but here an ordinary variable in a function is tested. Change-Id: Ibf8fc3efd43a6d8ea729eaaaf14ddeaa15804924 Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--tools/qmlcachegen/Qt5QuickCompilerConfig.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
index 16f8beece..26838a516 100644
--- a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
+++ b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
@@ -48,7 +48,7 @@ function(QTQUICK_COMPILER_ADD_RESOURCES outfiles)
string(REGEX REPLACE "[\r\n]+" ";" rcc_contents ${rcc_contents})
foreach(it ${rcc_contents})
get_filename_component(extension ${it} EXT)
- if("x${extension}" STREQUAL "x.qml" OR "x${extension}" STREQUAL "x.js" OR "x${extension}" STREQUAL "x.ui.qml")
+ if(extension STREQUAL ".qml" OR extension STREQUAL ".js" OR extension STREQUAL ".ui.qml")
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})