summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk@kdab.com>2019-02-13 09:45:18 +0100
committerKevin Funk <kevin.funk@kdab.com>2019-02-14 07:38:47 +0000
commitb2337e1d005212b607dd1bd6c8413c0d9b3b1bc2 (patch)
tree43fa9535a31fa58bc86f9194f4dd0d0f23231932 /cmake
parent766701a9b2b5a4124186fc4a026b5511bfa61b57 (diff)
cmake: Make sure QtModuleConfig.cmake.in is found
... when QtBuild.cmake is being included from another Qt module Change-Id: Ia55e03422cc84a56dd9eac640621e5b2ee9681bd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 37da7ac43e..93369ee965 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -39,6 +39,7 @@ set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]")
set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]")
set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]")
+set(QT_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}")
# the default RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
@@ -568,7 +569,7 @@ function(add_qt_module target)
endif()
configure_package_config_file(
- "${PROJECT_SOURCE_DIR}/cmake/QtModuleConfig.cmake.in"
+ "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake"
INSTALL_DESTINATION "${config_install_dir}"
)