Skip to content
  • Alexandru Croitor's avatar
    Make Qt relocatable · 4ac87263
    Alexandru Croitor authored
    
    
    [ChangeLog][QtCore] Qt installations on the host system can now be
    relocated, i.e. moved to other directories.
    
    Add a new feature 'relocatable' that's by default enabled for
    non-static builds
      - on platforms where libdl is available,
      - on macOS when configured with -framework,
      - on Windows.
    
    If the feature is enabled, the directory where plugins, translations
    and other assets are loaded from is determined by the location of
    libQt5Core.so and the lib dir (bin dir on Windows) relative to the
    prefix.
    
    For static builds, the feature 'relocatable' is off by default. It can
    be turned on manually by passing -feature-relocatable to configure. In
    that case, QLibraryInfo::location(QLibraryInfo::TranslationsPaths) and
    friends will return paths rooted in the user application's directory.
    
    The installed and relocated qmake determines properties like
    QT_INSTALL_PREFIX and QT_HOST_PREFIX from the location of the qmake
    executable and the host bin dir relative to the host prefix. This is
    now always done, independent of the 'relocatable' feature.
    
    Note that qmake is currently only relocatable within an environment
    that has the same layout as the original build machine due to absolute
    paths to the original prefix in .prl, .pc and .la files.
    This will be addressed in a separate patch.
    
    Task-number: QTBUG-15234
    Change-Id: I7319e2856d8fe17f277082d71216442f52580633
    Reviewed-by: default avatarAlexandru Croitor <alexandru.croitor@qt.io>
    4ac87263