From 498d9da89690d0c317e159bd31f682a003187641 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 28 Mar 2022 15:11:59 +0200 Subject: ECMQueryQt: don't fail when TRY is used Like is done in the Qt5 qmake code path. --- modules/ECMQueryQt.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ECMQueryQt.cmake b/modules/ECMQueryQt.cmake index f4e3bf7c..a6b5a163 100644 --- a/modules/ECMQueryQt.cmake +++ b/modules/ECMQueryQt.cmake @@ -56,8 +56,10 @@ elseif(QT_MAJOR_VERSION STREQUAL "6") find_program(_qtpaths_executable NAMES qtpaths6) if(NOT _qtpaths_executable) enable_language(CXX) - find_package(Qt6 COMPONENTS CoreTools REQUIRED CONFIG) - get_target_property(_qtpaths_executable Qt6::qtpaths LOCATION) + find_package(Qt6 COMPONENTS CoreTools QUIET CONFIG) + if (TARGET Qt6::qtpaths) + get_target_property(_qtpaths_executable Qt6::qtpaths LOCATION) + endif() endif() set(QUERY_EXECUTABLE ${_qtpaths_executable} CACHE FILEPATH "Location of the Qt6 qtpaths executable") -- cgit v1.2.1