summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/Qt5CoreMacros.cmake5
-rw-r--r--tests/auto/cmake/pass1/CMakeLists.txt3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index 41748b52ec..bc4c020826 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -214,7 +214,10 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.8)
endif()
foreach(_module ${modules})
if (NOT Qt5${_module}_FOUND)
- message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
+ find_package(Qt5${_module} PATHS ${_qt5_corelib_install_prefix} NO_DEFAULT_PATH)
+ if (NOT Qt5${_module}_FOUND)
+ message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
+ endif()
endif()
target_link_libraries(${_target} ${link_type} ${Qt5${_module}_LIBRARIES})
set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_module}_INCLUDE_DIRS})
diff --git a/tests/auto/cmake/pass1/CMakeLists.txt b/tests/auto/cmake/pass1/CMakeLists.txt
index d8efadc8ed..50a3375a15 100644
--- a/tests/auto/cmake/pass1/CMakeLists.txt
+++ b/tests/auto/cmake/pass1/CMakeLists.txt
@@ -10,8 +10,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(two two.cpp)
add_executable(three three.cpp)
-find_package(Qt5Test)
-find_package(Qt5Widgets)
+find_package(Qt5Core)
qt5_use_modules(two Test)
qt5_use_modules(three Widgets Test)