diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index 3b38eb037d..cd7fdf7c02 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -257,6 +257,12 @@ if(@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS AND _Qt_NOTFOUND_MESSAGE) unset(_Qt_NOTFOUND_MESSAGE) endif() +if(@INSTALL_CMAKE_NAMESPACE@_FOUND + AND COMMAND _qt_internal_override_example_install_dir_to_dot + AND NOT _qt_internal_example_dir_set_to_dot) + _qt_internal_override_example_install_dir_to_dot() +endif() + __qt_internal_defer_promote_targets_in_dir_scope_to_global() if(CMAKE_VERSION VERSION_LESS 3.21) __qt_internal_check_link_order_matters() diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 2464d0677f..ca0f512828 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -2664,6 +2664,7 @@ macro(_qt_internal_override_example_install_dir_to_dot) # to CMAKE_INSTALL_PREFIX. if(QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT) set(INSTALL_EXAMPLEDIR ".") + set(_qt_internal_example_dir_set_to_dot TRUE) endif() endmacro()