cmake: Don't reference global data in qt_internal_get_title_case

The only place the function was used was to generate the title case of
a target, so the issue wasn't spotted until now.

Change-Id: Iee66ecea569e7411c6b5a5e5312cde910a48fa01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3ad0f755f56eae4e8d94459f7cc17671e51e95da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2022-07-08 11:48:51 +02:00 committed by Qt Cherry-pick Bot
parent 191faa0626
commit d95ef16a08

View File

@ -75,7 +75,7 @@ function(qt_internal_get_title_case value out_var)
endif()
string(SUBSTRING "${value}" 0 1 first_char)
string(TOUPPER "${first_char}" first_char_upper)
string(SUBSTRING "${target}" 1 -1 rest_of_value)
string(SUBSTRING "${value}" 1 -1 rest_of_value)
set(title_value "${first_char_upper}${rest_of_value}")
set(${out_var} "${title_value}" PARENT_SCOPE)
endfunction()