CMake: Fix EntryPointMinGW32Target to be found in top-level build

The file needs to be copied into the top-level build config dir.

Amends 7531994379

Pick-to: 6.2
Fixes: QTBUG-97919
Change-Id: I8e0b525cfbd89ce5c7b07b62bfc023a7f8650cb9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Alexandru Croitor 2021-11-02 08:52:34 +01:00
parent 62c2d990f9
commit 67dadc7e34

View File

@ -27,6 +27,12 @@ if(MINGW)
configure_file("EntryPointMinGW32Target.cmake.in" "${mingw32target_config_file}" @ONLY)
qt_copy_or_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${mingw32target_config_file}"
DESTINATION "${config_install_dir}")
# In prefix builds we also need to copy the file into the build config directory, so that the
# build-dir Qt6Config.cmake finds the files when building other repos in a top-level build.
if(QT_WILL_INSTALL)
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/${mingw32target_config_file}"
DESTINATION "${config_install_dir}")
endif()
include("${CMAKE_CURRENT_BINARY_DIR}/${mingw32target_config_file}")
set(extra_cmake_includes_arg EXTRA_CMAKE_INCLUDES "${mingw32target_config_file}")
endif()