Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-90449

Wrong CMAKE_INSTALL_PREFIX when building a module against an installer-provided Qt

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.0 Beta3
    • 6.0.0
    • Build System: CMake
    • None
    • All
    • e6527e2f73663205a0f36feac5a7feda47fba152 (qt/qtbase/dev) 8e5f2252ccb8a5080ad95967f19d8d4f8e6e6701 (qt/qtbase/6.1)

    Description

      How to reproduce

      • install Qt with the installer
      • qt-configure-module some other Qt module (qtsvg for example) with that installed Qt

      What happens

      CMAKE_INSTALL_PREFIX is set to /Users/qt/work/install which is the install prefix on the packaging machine

      What should happen

      CMAKE_INSTALL_PREFIX should be the actual installation location of Qt.

      Notes

      This happens, because QtBuildInternalsExtras.cmake contains the hard-coded value /Users/qt/work/install:

      if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND
         NOT QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX)
          set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" CACHE PATH
              "Install path prefix, prepended onto install directories." FORCE)
      endif()
      

      possible solution is

      if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND
         NOT QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX)
          set(CMAKE_INSTALL_PREFIX "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}" CACHE PATH
              "Install path prefix, prepended onto install directories." FORCE)
      endif()
      

      but we need to double-check all implications.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-90449
          # Subject Branch Project Status CR V

          Activity

            People

              qtbuildsystem Qt Build System Team
              jbornema Joerg Bornemann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes