Fix build of modules outside of QtBase when cross-compiling

The Qt::Platform target includes the mkspecs/$spec directory, which we
must unconditionally install as long as we use it.

Change-Id: I272650a887b5b0b3bd868524784dca65b76b02d9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
This commit is contained in:
Simon Hausmann 2019-06-21 16:45:37 +02:00
parent 2895f3ffaa
commit a39a0e5419
2 changed files with 9 additions and 8 deletions

View File

@ -72,6 +72,15 @@ if (QT_WILL_BUILD_TOOLS)
add_subdirectory(qmake)
endif()
# As long as we use the mkspecs (for qplatformdefs.h), we need to always
# install it, especially when cross-compiling.
set(mkspecs_install_dir "${INSTALL_DATADIR}")
qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${mkspecs_install_dir})
qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs"
DESTINATION ${mkspecs_install_dir})
qt_build_repo_end()
option(BUILD_EXAMPLES "Build Qt examples" ON)

View File

@ -1,13 +1,5 @@
# Generated from qmake.pro.
# special case begin
set(path_component "${INSTALL_DATADIR}")
qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${path_component})
qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs"
DESTINATION ${mkspecs_install_dir})
# special case end
#####################################################################
## qmake Binary:
#####################################################################