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

Incorrect conflict resolution for variables in multiple inherited presets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 16.0.1
    • None
    • Linux/X11

    Description

      CMake allows presets to inherit from multiple other presets. If a variable is set in multiple inherited presets, CMake documentation specifies that the value should be taken from the preset that is closest to the beginning of the list (https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html):

      If multiple inherits presets provide conflicting values for the same field, the earlier preset in the inherits array will be preferred.

      This does not seem to be the case with Qt Creator. It uses value from the later preset.

      I'm attaching a simple test project.

      When building preset "should-say-a" with CMake the output is as follows:

      % cmake --preset should-say-a -B build
      % cmake --build build
      % build/cmake-preset-test
      Variable is set to: a
      

      After opening the project with Qt Creator and building "should-say-a" preset, the output is:

      Variable is set to: b
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cadam Cristian Adam
            ievgenii.meshcheriakov Ievgenii Meshcheriakov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes