Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25142

CMake build: please use the GNUInstallDirs module

    XMLWordPrintable

Details

    • c81baf1a9cc938a283f6c52c8fd10bab84183391 (qt-creator/qt-creator/4.14)

    Description

      As of 4.14.0, the CMake build system of Qt Creator hardcodes all the installation paths for binaries/libraries/etc in cmake/QtCreatorAPIInternal.cmake.

      This suboptimal, as some of these paths must be tweaked when building on Linux and other Unix (e.g. *BSD) distributions, according to the distro policies: e.g. the multiarch library path for Debian-based systems, the multilib library path for RPM distros, and so on.

      CMake already provides a way to set these paths according to the GNU coding standards:

      https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

      This module also works non non-Linux Unix systems like *BSDs, and it also allows people building to change the paths.

      I can understand this is not needed on Windows and macOS, so IMHO it could be OK to use it like:

      if (APPLE)
      elseif (WIN32)
      else ()
        include(GNUInstallDirs)
        # use it
      endif ()
      

      Note: sinceĀ QtCreatorAPI (which include()s ) is include()d before project(), then this breaks some of the bits that GNUInstallDirs sets (like ${CMAKE_LIBRARY_ARCHITECTURE}). Hence, that include() ought to be moved after project().

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-25142
        # Subject Branch Project Status CR V

        Activity

          People

            con Eike Ziller
            pinotree Pino Toscano
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes