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>
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)