From 1ac2e850258c2162d0cf1a276bd1f9886113e746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 13 Mar 2021 11:26:45 +0200 Subject: [PATCH] qtpaths: Fix cross compilation for windows The cmake target may not be named "qtpaths", but one should be using ${target_name} instead. If cross compiling, and QT_BUILD_TOOLS_WHEN_CROSSCOMPILING isn't set, the tool won't be built at all and there's no such target to set properties on, and if it isn't set, the target name is something else. Change-Id: I3d904036106b38df6e56ad35d400cf9a0bb1cbdf Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- src/tools/qtpaths/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qtpaths/CMakeLists.txt b/src/tools/qtpaths/CMakeLists.txt index a866000eaa..412ef5a0f9 100644 --- a/src/tools/qtpaths/CMakeLists.txt +++ b/src/tools/qtpaths/CMakeLists.txt @@ -17,8 +17,8 @@ qt_internal_add_tool(${target_name} ## Scopes: ##################################################################### -if(WIN32) - set_target_properties(qtpaths PROPERTIES +if(WIN32 AND TARGET ${target_name}) + set_target_properties(${target_name} PROPERTIES WIN32_EXECUTABLE FALSE ) endif()