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

Set QTC_RUN when evaluating CMake presets

XMLWordPrintable

    • 5a3d8b755 (17.0)

      A project I'm currently working on has a large number of presets, most of which are not typically used by developers. However, Qt Creator of course lists all of them when first configuring the project. I'd like to reduce the number of shown presets to make it easier for other developers to get an overview over typical build configurations as well as helping them find the preset(s) they're trying to build.

      According to the documentation, Qt Creator sets the env variable QTC_RUN when executing cmake. My first attempt thus was to add a condition QTC_RUN != 1 to all those presets I didn't want to show up:

      {
        "version": 6,
        "cmakeMinimumRequired": {
          "major": 3,
          "minor": 25,
          "patch": 0
        },
        "configurePresets": [
          {
             "name": "test-qtc-run-condition",
             "condition": {
               "type": "notEquals",
               "lhs": "$env{QTC_RUN}",
               "rhs": "1"
             }
          }
        ]
      }

      However, Qt Creator doesn't seem to be setting this variable when evaluating CMake presets, so they still show up.

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

            cadam Cristian Adam
            berglerma Manuel Bergler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes