aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2022-03-28 15:11:59 +0200
committerAhmad Samir <a.samirh78@gmail.com>2022-03-28 15:11:59 +0200
commit498d9da89690d0c317e159bd31f682a003187641 (patch)
treedd2193394ca91eb42317d40bc0c603a0ddcd20ca
parent19311d26a6142cf6722d64834133664c68ac5865 (diff)
downloadextra-cmake-modules-498d9da89690d0c317e159bd31f682a003187641.tar.gz
extra-cmake-modules-498d9da89690d0c317e159bd31f682a003187641.tar.bz2
ECMQueryQt: don't fail when TRY is used
Like is done in the Qt5 qmake code path.
-rw-r--r--modules/ECMQueryQt.cmake6
1 files 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")