diff --git a/mkspecs/cmake/Qt5ConfigVersion.cmake.in b/mkspecs/cmake/Qt5ConfigVersion.cmake.in index 96ea9c000d..e804754912 100644 --- a/mkspecs/cmake/Qt5ConfigVersion.cmake.in +++ b/mkspecs/cmake/Qt5ConfigVersion.cmake.in @@ -1,5 +1,5 @@ -set(PACKAGE_VERSION $$eval(QT.$${MODULE}.VERSION)) +set(PACKAGE_VERSION $$CMAKE_PACKAGE_VERSION) if(\"\${PACKAGE_VERSION}\" VERSION_LESS \"\${PACKAGE_FIND_VERSION}\") set(PACKAGE_VERSION_COMPATIBLE FALSE) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index b168dad9f2..29d256db7f 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -156,6 +156,8 @@ INSTALLS += cmake_qt5_module_files cmake_config_file.input = $$PWD/../cmake/Qt5BasicConfig.cmake.in cmake_config_file.output = $$DESTDIR/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Config.cmake +CMAKE_PACKAGE_VERSION = $$eval(QT.$${MODULE}.VERSION) + cmake_config_version_file.input = $$PWD/../cmake/Qt5ConfigVersion.cmake.in cmake_config_version_file.output = $$DESTDIR/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake