From 5cd4001bf2a7f0894c6ac269860e833b02df6cde Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Fri, 25 Nov 2016 13:12:54 +0300 Subject: Use separate Qt5Config.cmake inside build directory Qt5Config restricts search paths of Qt components to ${_qt5_install_prefix} to prevent accidentally using system Qt modules in case of restricted Qt configuration. However this does not work properly when Qt is used without installation, in particular when building cmake-based QtWebKit as a Qt submodule, because ${_qt5_install_prefix} resolves to QtBase and does not contain components from other modules. This patch changes search path from ${_qt5_install_prefix} to all qt5 subdirectories. Change-Id: Icf01a256097710889573ad69d847b9c3bffa1449 Reviewed-by: Kevin Funk Reviewed-by: Oswald Buddenhagen --- src/corelib/Qt5ModuleLocation.cmake.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/corelib/Qt5ModuleLocation.cmake.in (limited to 'src/corelib/Qt5ModuleLocation.cmake.in') diff --git a/src/corelib/Qt5ModuleLocation.cmake.in b/src/corelib/Qt5ModuleLocation.cmake.in new file mode 100644 index 0000000000..5065ada56e --- /dev/null +++ b/src/corelib/Qt5ModuleLocation.cmake.in @@ -0,0 +1,15 @@ +!!IF !isEmpty(_QMAKE_SUPER_CACHE_) +get_filename_component(_qt5_root_dir \"${CMAKE_CURRENT_LIST_DIR}/../../../..\" ABSOLUTE) + +file(GLOB qtmodules ${_qt5_root_dir} "${_qt5_root_dir}/*") +foreach(qtmodule ${qtmodules}) + if(IS_DIRECTORY ${qtmodule}) + list(APPEND _qt5_module_paths ${qtmodule}) + endif() +endforeach() +!!ELSE +set(_qt5_root_dir ${_qt5_install_prefix}) +set(_qt5_module_paths ${_qt5_install_prefix}) +!!ENDIF + +set(_qt5_module_location_template ${_qt5_root_dir}) -- cgit v1.2.3