Only find dependencies from the same Qt installation.
authorStephen Kelly <stephen.kelly@kdab.com>
Thu, 10 May 2012 15:55:13 +0000 (17:55 +0200)
committerQt by Nokia <qt-info@nokia.com>
Sun, 13 May 2012 16:49:10 +0000 (18:49 +0200)
Add a PATH to search for dependencies in the current prefix, and
disable other CMake searching logic with NO_DEFAULT_PATH.

A Qt installation must all be installed to the same prefix currently.
If that constraint is ever relaxed, we can turn this into a hint instead.

Change-Id: I633cafb7e546dbd102ac0b2ed18db260d26adc51
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
mkspecs/cmake/Qt5BasicConfig.cmake.in

index f3c7206..60024e5 100644 (file)
@@ -31,7 +31,11 @@ endif()
 
 foreach(_module_dep ${_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES})
     if (NOT Qt5${_module_dep}_FOUND)
-        find_package(Qt5${_module_dep} ${_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET} ${_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED})
+        find_package(Qt5${_module_dep}
+            ${_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET}
+            ${_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED}
+            PATHS "${_qt5$${CMAKE_MODULE_NAME}_install_prefix}" NO_DEFAULT_PATH
+        )
     endif()
 
     if (NOT Qt5${_module_dep}_FOUND)