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

CMake Presets import misconfigures Ninja Multi-Config Release

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 14.0.1
    • None
    • Windows

    Description

      I have this CMakePresets.json:

      {
          "version": 5,
          "configurePresets": [
              {
                  "name": "User-MSVC-VS-2022-x64",
                  "description": "TechnoTeam Ninja Multi-Config Build",
                  "generator": "Ninja Multi-Config",
                  "environment": {
                      "TT_EXTERNAL_BASE_PATH": "C:/TechnoTeam/develop",
                      "PATH": "C:/Windows;C:/Windows/system32;C:/Windows/System32/WindowsPowerShell/v1.0;$env{TT_EXTERNAL_BASE_PATH}/usr/opt/tools/bin;$env{TT_EXTERNAL_BASE_PATH}/usr/bin"
                  },
                  "cmakeExecutable": "$env{TT_EXTERNAL_BASE_PATH}/usr/opt/tools/bin/cmake.exe",
                  "toolchainFile": "${sourceDir}/CMake/toolchain/windows_msvc.cmake",
                  "binaryDir": "${sourceParentDir}/${sourceDirName}Build",
                  "cacheVariables": {
                      "CMAKE_VS_VERSION_RANGE": "[17.0,18.0)",
                      "CMAKE_CONFIGURATION_TYPES": "Debug;Release"
                  },
                  "condition": {
                      "type": "equals",
                      "lhs": "${hostSystemName}",
                      "rhs": "Windows"
                  }
              }
          ],
          "buildPresets": [
              {
                  "name": "Debug-User-MSVC-VS-2022-x64",
                  "displayName": "Debug",
                  "configurePreset": "User-MSVC-VS-2022-x64",
                  "configuration": "Debug"
              },
              {
                  "name": "Release-User-MSVC-VS-2022-x64",
                  "displayName": "Release",
                  "configurePreset": "User-MSVC-VS-2022-x64",
                  "configuration": "Release"
              }
          ]
      } 

      QtCreator converts this into a kit when configuring the project.

      The Build Configurations are converted to Build Steps. For Debug it enables the Debug and disables the Release build command. For Release is does the same, so it also builds Debug.

      The expected behavior would be to enable Release and disable Debug build step in Release mode.

      Of course it would be even better to not import the other build configuration at all as build step.


      In the middle run QtCreator should implement a proper Multi-Config mode. Currently the configuration can be changed for Debug and Release which makes no sense for Multi Config, because there is only one common configuration for both.

      Attachments

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

        Activity

          People

            cadam Cristian Adam
            bebuch Benjamin Buch
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes