Replace invalid symbols with underscore

When building tests for android some resources names had the "#"
character in them which triggered a CMake error when use in conjunction
with add_custom_target()

Change-Id: If5f471eebb027683e86b0c4e38c2f34ff8891b7a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2019-08-22 15:41:10 +02:00
parent 24bdc6e156
commit 46603d655d

View File

@ -89,6 +89,7 @@ function(__qt_quick_compiler_process_resources target resource_name)
string(REGEX REPLACE "\.js$" "_js" compiled_file ${file_relative})
string(REGEX REPLACE "\.mjs$" "_mjs" compiled_file ${compiled_file})
string(REGEX REPLACE "\.qml$" "_qml" compiled_file ${compiled_file})
string(REGEX REPLACE "[\$#\?]+" "_" compiled_file ${compiled_file})
set(compiled_file "${CMAKE_CURRENT_BINARY_DIR}/qmlcache/${resource_name}/${compiled_file}.cpp")
add_custom_command(
OUTPUT ${compiled_file}