From 1b32185a7a4d55c68d8accfa9b463dbe0d4bef57 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Apr 2013 17:28:27 +0200 Subject: Make qt5_use_modules find dependents only in the parent directory. Similar to 70420ec3 (Look for cmake package dependents only in the parent directory., 2013-04-02), make sure this cmake function only searches for sibling packages as dependencies. Change-Id: Icab23d333fa6a750ee262b592fae39f0ba334fee Reviewed-by: Stephen Kelly --- src/corelib/Qt5CoreMacros.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index e3115db8ee..b6124b40cd 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -215,6 +215,7 @@ function(QT5_ADD_RESOURCES outfiles ) set(${outfiles} ${${outfiles}} PARENT_SCOPE) endfunction() +set(_Qt5_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..") if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) macro(qt5_use_modules _target _link_type) @@ -234,7 +235,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) foreach(_module ${_qt5_modules}) if (NOT Qt5${_module}_FOUND) - find_package(Qt5${_module} PATHS ${_qt5Core_install_prefix} NO_DEFAULT_PATH) + find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH) if (NOT Qt5${_module}_FOUND) message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") endif() -- cgit v1.2.3