CMake: Add function to get tool wrapper shell script path
The _qt_internal_wrap_tool_command function has a limitation that it is not possible to use it when a command needs to be wrapper in a generator expression. Provide a lower level API called _qt_internal_get_tool_wrapper_script_path to just get the path to the wrapper script, ensuring that the script is created if needed. Deprecate _qt_internal_wrap_tool_command, in favor of replacing it with the new API. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Ie4a4a17178bf2061ae01ee2b03b052d84560abf9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 59e08d21058661d9972da4840a82e2bc80d02741)
This commit is contained in:
parent
af165e9704
commit
f1fe9ae895
@ -263,7 +263,7 @@ function(qt_setup_tool_path_command)
|
|||||||
list(APPEND command COMMAND)
|
list(APPEND command COMMAND)
|
||||||
list(APPEND command set PATH=${bindir}$<SEMICOLON>%PATH%)
|
list(APPEND command set PATH=${bindir}$<SEMICOLON>%PATH%)
|
||||||
set(QT_TOOL_PATH_SETUP_COMMAND "${command}" CACHE INTERNAL "internal command prefix for tool invocations" FORCE)
|
set(QT_TOOL_PATH_SETUP_COMMAND "${command}" CACHE INTERNAL "internal command prefix for tool invocations" FORCE)
|
||||||
# QT_TOOL_PATH_SETUP_COMMAND is deprecated. Please use _qt_internal_wrap_tool_command
|
# QT_TOOL_PATH_SETUP_COMMAND is deprecated. Please use _qt_internal_get_wrap_tool_script_path
|
||||||
# instead.
|
# instead.
|
||||||
endfunction()
|
endfunction()
|
||||||
qt_setup_tool_path_command()
|
qt_setup_tool_path_command()
|
||||||
|
@ -110,6 +110,11 @@ endfunction()
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# APPEND Selects the 'append' mode for the out_variable argument.
|
# APPEND Selects the 'append' mode for the out_variable argument.
|
||||||
# SET Selects the 'set' mode for the out_variable argument.
|
# SET Selects the 'set' mode for the out_variable argument.
|
||||||
|
#
|
||||||
|
# FIXME: Replace all usages of _qt_internal_wrap_tool_command
|
||||||
|
# with _qt_internal_get_wrap_tool_script_path and remove the former.
|
||||||
|
# The former always adds the COMMAND keyword, which does not allow the caller to wrap the
|
||||||
|
# commands in a generator expression. See _qt_internal_target_enable_qmllint for an example.
|
||||||
function(_qt_internal_wrap_tool_command out_variable action)
|
function(_qt_internal_wrap_tool_command out_variable action)
|
||||||
set(append FALSE)
|
set(append FALSE)
|
||||||
if(action STREQUAL "APPEND")
|
if(action STREQUAL "APPEND")
|
||||||
@ -130,3 +135,11 @@ function(_qt_internal_wrap_tool_command out_variable action)
|
|||||||
endif()
|
endif()
|
||||||
set(${out_variable} "${${out_variable}}" PARENT_SCOPE)
|
set(${out_variable} "${${out_variable}}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Gets the path to tool wrapper shell script.
|
||||||
|
function(_qt_internal_get_tool_wrapper_script_path out_variable)
|
||||||
|
# Ensure the script wrapper exists.
|
||||||
|
_qt_internal_generate_tool_command_wrapper()
|
||||||
|
|
||||||
|
set(${out_variable} "${QT_TOOL_COMMAND_WRAPPER_PATH}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user