summaryrefslogtreecommitdiffstats
path: root/cmake/QtToolsConfig.cmake.in
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/QtToolsConfig.cmake.in')
-rw-r--r--cmake/QtToolsConfig.cmake.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/cmake/QtToolsConfig.cmake.in b/cmake/QtToolsConfig.cmake.in
new file mode 100644
index 0000000000..7b2fa1de74
--- /dev/null
+++ b/cmake/QtToolsConfig.cmake.in
@@ -0,0 +1,35 @@
+@PACKAGE_INIT@
+
+get_filename_component(_qt_tools_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
+
+ if (NOT @INSTALL_CMAKE_NAMESPACE@Tools_FIND_COMPONENTS)
+ set(@INSTALL_CMAKE_NAMESPACE@Tools_NOT_FOUND_MESSAGE
+ "The Qt tools package requires at least one component.")
+ set(@INSTALL_CMAKE_NAMESPACE@Tools_FOUND False)
+ return()
+ endif()
+
+foreach(module ${@INSTALL_CMAKE_NAMESPACE@Tools_FIND_COMPONENTS})
+ find_package(@INSTALL_CMAKE_NAMESPACE@${module}Tools
+ ${_@INSTALL_CMAKE_NAMESPACE@Tools_FIND_PARTS_QUIET}
+ ${_@INSTALL_CMAKE_NAMESPACE@Tools_FIND_PARTS_REQUIRED}
+ PATHS ${_qt_tools_cmake_dir} NO_DEFAULT_PATH
+ )
+ if (NOT @INSTALL_CMAKE_NAMESPACE@${module}Tools_FOUND)
+ string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY)
+
+ if (@INSTALL_CMAKE_NAMESPACE@_FIND_REQUIRED_${module})
+ set(_Qt_NOTFOUND_MESSAGE
+ "${_Qt_NOTFOUND_MESSAGE}Failed to find Qt component \"${module}\" config file.")
+ elseif(NOT Qt_FIND_QUIETLY)
+ message(WARNING "Failed to find Qt component \"${module}\" config file.")
+ endif()
+
+ unset(_expected_module_location)
+ endif()
+endforeach()
+
+if (_Qt_NOTFOUND_MESSAGE)
+ set(@INSTALL_CMAKE_NAMESPACE@Tools_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}")
+ set(@INSTALL_CMAKE_NAMESPACE@Tools_FOUND False)
+endif()