From 5a779a4ad350accadc4337d332eedb29ba1cc26b Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Mon, 27 Apr 2020 15:04:57 +0200 Subject: CMake: Make it possible to build tools when cross-compiling This patch allows tools to be built for the target platform when the QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration time. To avoid naming conflicts, the target tools are suffixed with "_native". The qt_get_tool_target_name() function can be used to get the tool name for both scenarios (cross and non-cross compilation). Extend pro2cmake to refer to the right target name for tools. The relevant write_XXX functions have a new target_ref parameter that will be "${target_name}" for tools and literally the target name for everything else. Fixes: QTBUG-81901 Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e Reviewed-by: Alexandru Croitor --- src/tools/qvkgen/.prev_CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tools/qvkgen/.prev_CMakeLists.txt') diff --git a/src/tools/qvkgen/.prev_CMakeLists.txt b/src/tools/qvkgen/.prev_CMakeLists.txt index a4a12354f6..ed8c028686 100644 --- a/src/tools/qvkgen/.prev_CMakeLists.txt +++ b/src/tools/qvkgen/.prev_CMakeLists.txt @@ -4,7 +4,8 @@ ## qvkgen Tool: ##################################################################### -qt_add_tool(qvkgen +qt_get_tool_target_name(target_name qvkgen) +qt_add_tool(${target_name} TARGET_DESCRIPTION "Qt Vulkan Header Generator" SOURCES qvkgen.cpp -- cgit v1.2.3