Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
Cross compilation environments
-
eebf42cc0d99534e26da7510c3e72fba339b9829,e6bade8f87f849c4c155d5f527c94ada596cf193
Description
When building Qt, you can specify where you would like host tools too be installed, like qmake, moc, rcc, etc by using the -hostprefix configuration argument. This makes sense when cross-compiling because these tools are built for the host system (ex x86_64). That way the libraries are cross compiled for whatever arch/system, and installed into the -prefix (sysroot), and host tools are installed else where.
The problem is that the generated cmake files define the location of the host tools relative to their own location.
get_filename_component(_qt5_corelib_install_prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) if (NOT TARGET Qt5::qmake) add_executable(Qt5::qmake IMPORTED) set_target_properties(Qt5::qmake PROPERTIES IMPORTED_LOCATION "${_qt5_corelib_install_prefix}/bin/qmake" ) endif() if (NOT TARGET Qt5::moc) add_executable(Qt5::moc IMPORTED) set_target_properties(Qt5::moc PROPERTIES IMPORTED_LOCATION "${_qt5_corelib_install_prefix}/bin/moc" ) # For CMake automoc feature get_target_property(QT_MOC_EXECUTABLE Qt5::moc LOCATION) endif()
This location is inside of the -prefix location, which will place moc within the sysroot. When -hostprefix has been defined during configuration, moc wont exist in this hard-coded location, so when these macro files are generated they need to take into consideration the value of -hostprefix.
Attachments
Issue Links
- depends on
-
QTBUG-29241 mkspecs are not installed to QT_INSTALL_ARCHDATA if -hostprefix is used.
- Closed