Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator CMake Presets: Temporary kit creation falls back to the wrong kit/toolchain

Qt Creator CMake Presets: Temporary kit creation falls back to the wrong kit/toolchain

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 58 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Enes Alp
    wrote last edited by
    #1

    Hi, I’m seeing inconsistent kit/toolchain resolution when Qt Creator imports CMake Presets and creates -temporary kits. It shows up clearly in Android scenarios, but the root issue seems broader than Android-specific and likely related to Qt Creator’s preset -> temporary kit mapping logic.

    Summary

    • The same preset configures successfully from terminal.
    • In Qt Creator, the same preset may be attached to an incorrect temporary kit.
    • In failure cases, Qt Creator falls back to host toolchain/host Qt.

    Environment

    • Qt Creator: 18.0.x
    • CMake Presets version: 5
    • CMake: /opt/homebrew/bin/cmake
    • Ninja: /opt/homebrew/bin/ninja
    • Project uses both CMakePresets.json and CMakeUserPresets.json.

    Expected behavior

    • When importing presets, temporary kits should resolve toolchain/device/Qt consistently with the preset context.
    • If cmake --preset <name> works in terminal, Qt Creator should resolve the same configuration similarly.

    Actual behavior

    • Temporary kit sometimes falls back to Desktop/host setup.
    • The temporary kit name still reflects the preset, but compiler/debugger/Qt can be host-side.
    • This leads to ABI mismatch and configure/build errors.

    How to reproduce (general flow)

    • Open a preset-based project in Qt Creator.
    • Run Build > Reload CMake Presets.
    • Inspect generated ... (CMake preset) - temporary kit details.
    • In some cases, toolchain/Qt resolution falls back to host instead of preset target.

    What I already tried

    • architecture/toolset with strategy: external.
    • Explicit compiler/Qt paths in cacheVariables.
    • vendor.qt.io/QtCreator/1.0 usage (notably debugger settings).
    • Deleting/recreating temporary kits.
    • Clearing preset cache and reloading presets.

    Important note

    • cmake --preset <name> succeeds in terminal.
    • The issue appears during Qt Creator preset import and temporary kit generation.

    Questions

    • Is this a known issue?
    • Is there an officially recommended way to make temporary kit toolchain resolution deterministic?
    • Is there any supported preset field to force Qt Creator to use a specific auto-detected toolchain for temporary kits?

    cbaa757c-dbe4-4516-b303-b13f7b3f404f-image.png

    CMakePresets.json

    {
      "version": 5,
      "cmakeMinimumRequired": { "major": 3, "minor": 30, "patch": 0 },
      "configurePresets": [
        {
          "name": "android-base",
          "hidden": true,
          "generator": "Ninja",
          "binaryDir": "${sourceDir}/build/${presetName}",
          "cacheVariables": {
            "VCPKG_MANIFEST_MODE": "ON",
            "ANDROID_SDK_ROOT": "$env{ANDROID_SDK_ROOT}"
          }
        },
        {
          "name": "android-armv7-release",
          "displayName": "Android ARMv7 Release (armeabi-v7a)",
          "inherits": "android-base",
          "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
          "cacheVariables": {
            "CMAKE_BUILD_TYPE": "Release",
            "ANDROID_ABI": "armeabi-v7a",
            "ANDROID_PLATFORM": "android-30",
            "ANDROID_STL": "c++_shared",
     
            "VCPKG_TARGET_TRIPLET": "arm-android-custom",
            "VCPKG_HOST_TRIPLET": "arm64-osx",
            "VCPKG_CHAINLOAD_TOOLCHAIN_FILE":
              "$env{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake",
     
            "CMAKE_PREFIX_PATH": "$env{QT_ANDROID_ARMV7}",
            "Qt6_DIR": "$env{QT_ANDROID_ARMV7}/lib/cmake/Qt6",
    
            "CMAKE_FIND_ROOT_PATH_MODE_PACKAGE": "BOTH"
          }
        },
        {
          "name": "android-armv7-debug",
          "displayName": "Android ARMv7 Debug (armeabi-v7a)",
          "inherits": "android-armv7-release",
          "cacheVariables": {
            "CMAKE_BUILD_TYPE": "Debug"
          }
        },
        {
          "name": "android-arm64-release",
          "displayName": "Android ARM64 Release (arm64-v8a)",
          "inherits": "android-base",
          "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
          "cacheVariables": {
            "CMAKE_BUILD_TYPE": "Release",
            "ANDROID_ABI": "arm64-v8a",
            "ANDROID_PLATFORM": "android-30",
            "ANDROID_STL": "c++_shared",
     
            "VCPKG_TARGET_TRIPLET": "arm64-android-custom",
            "VCPKG_HOST_TRIPLET": "arm64-osx",
            "VCPKG_CHAINLOAD_TOOLCHAIN_FILE":
              "$env{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake",
     
            "CMAKE_PREFIX_PATH": "$env{QT_ANDROID_ARM64}",
            "Qt6_DIR": "$env{QT_ANDROID_ARM64}/lib/cmake/Qt6",
    
            "CMAKE_FIND_ROOT_PATH_MODE_PACKAGE": "BOTH"
          }
        },
        {
          "name": "android-arm64-debug",
          "displayName": "Android ARM64 Debug (arm64-v8a)",
          "inherits": "android-arm64-release",
          "cacheVariables": {
            "CMAKE_BUILD_TYPE": "Debug"
          }
        }
      ],
      "buildPresets": [
        { "name": "android-arm64-release", "configurePreset": "android-arm64-release" },
        { "name": "android-arm64-debug", "configurePreset": "android-arm64-debug" },
        { "name": "android-armv7-release", "configurePreset": "android-armv7-release" },
        { "name": "android-armv7-debug", "configurePreset": "android-armv7-debug" }
      ]
    }
    

    CMakeUserPresets.json

    {
      "version": 5,
      "configurePresets": [
        {
          "name": "user-android-base",
          "hidden": true,
          "environment": {
            "ANDROID_SDK_ROOT": "/Users/techalp/Android",
            "ANDROID_NDK_HOME": "/Users/techalp/Android/ndk/27.2.12479018",
            "VCPKG_ROOT": "/Users/techalp/vcpkg",
            "QT_ANDROID_ARMV7": "/Users/techalp/Qt/6.10.1/android_armv7",
            "QT_ANDROID_ARM64": "/Users/techalp/Qt/6.10.1/android_arm64_v8a",
            "QT_HOST_PATH": "/Users/techalp/Qt/6.10.1/macos"
          },
          "cacheVariables": {
            "CMAKE_MAKE_PROGRAM": "/opt/homebrew/bin/ninja"
          }
        },
        {
          "name": "user-android-arm64-base",
          "hidden": true,
          "inherits": "user-android-base",
          "cacheVariables": {
            "CMAKE_PREFIX_PATH": "/Users/techalp/Qt/6.10.1/android_arm64_v8a",
            "Qt6_DIR": "/Users/techalp/Qt/6.10.1/android_arm64_v8a/lib/cmake/Qt6",
            "QT_QMAKE_EXECUTABLE": "/Users/techalp/Qt/6.10.1/android_arm64_v8a/bin/qmake6",
            "CMAKE_FIND_ROOT_PATH": "/Users/techalp/Qt/6.10.1/android_arm64_v8a"
          }
        },
        {
          "name": "user-android-armv7-base",
          "hidden": true,
          "inherits": "user-android-base",
          "cacheVariables": {
            "CMAKE_PREFIX_PATH": "/Users/techalp/Qt/6.10.1/android_armv7",
            "Qt6_DIR": "/Users/techalp/Qt/6.10.1/android_armv7/lib/cmake/Qt6",
            "QT_QMAKE_EXECUTABLE": "/Users/techalp/Qt/6.10.1/android_armv7/bin/qmake6",
            "CMAKE_FIND_ROOT_PATH": "/Users/techalp/Qt/6.10.1/android_armv7"
          }
        },
        {
          "name": "user-android-arm64-debug",
          "displayName": "User Android ARM64 Debug",
          "inherits": ["user-android-arm64-base", "android-arm64-debug"]
        },
        {
          "name": "user-android-arm64-release",
          "displayName": "User Android ARM64 Release",
          "inherits": ["user-android-arm64-base", "android-arm64-release"]
        },
        {
          "name": "user-android-armv7-debug",
          "displayName": "User Android ARMv7 Debug",
          "inherits": ["user-android-armv7-base", "android-armv7-debug"]
        },
        {
          "name": "user-android-armv7-release",
          "displayName": "User Android ARMv7 Release",
          "inherits": ["user-android-armv7-base", "android-armv7-release"]
        }
      ],
      "buildPresets": [
        { "name": "user-android-arm64-debug", "configurePreset": "user-android-arm64-debug" },
        { "name": "user-android-arm64-release", "configurePreset": "user-android-arm64-release" },
        { "name": "user-android-armv7-debug", "configurePreset": "user-android-armv7-debug" },
        { "name": "user-android-armv7-release", "configurePreset": "user-android-armv7-release" }
      ]
    }
    
    cristian-adamC 1 Reply Last reply
    1
    • E Enes Alp

      Hi, I’m seeing inconsistent kit/toolchain resolution when Qt Creator imports CMake Presets and creates -temporary kits. It shows up clearly in Android scenarios, but the root issue seems broader than Android-specific and likely related to Qt Creator’s preset -> temporary kit mapping logic.

      Summary

      • The same preset configures successfully from terminal.
      • In Qt Creator, the same preset may be attached to an incorrect temporary kit.
      • In failure cases, Qt Creator falls back to host toolchain/host Qt.

      Environment

      • Qt Creator: 18.0.x
      • CMake Presets version: 5
      • CMake: /opt/homebrew/bin/cmake
      • Ninja: /opt/homebrew/bin/ninja
      • Project uses both CMakePresets.json and CMakeUserPresets.json.

      Expected behavior

      • When importing presets, temporary kits should resolve toolchain/device/Qt consistently with the preset context.
      • If cmake --preset <name> works in terminal, Qt Creator should resolve the same configuration similarly.

      Actual behavior

      • Temporary kit sometimes falls back to Desktop/host setup.
      • The temporary kit name still reflects the preset, but compiler/debugger/Qt can be host-side.
      • This leads to ABI mismatch and configure/build errors.

      How to reproduce (general flow)

      • Open a preset-based project in Qt Creator.
      • Run Build > Reload CMake Presets.
      • Inspect generated ... (CMake preset) - temporary kit details.
      • In some cases, toolchain/Qt resolution falls back to host instead of preset target.

      What I already tried

      • architecture/toolset with strategy: external.
      • Explicit compiler/Qt paths in cacheVariables.
      • vendor.qt.io/QtCreator/1.0 usage (notably debugger settings).
      • Deleting/recreating temporary kits.
      • Clearing preset cache and reloading presets.

      Important note

      • cmake --preset <name> succeeds in terminal.
      • The issue appears during Qt Creator preset import and temporary kit generation.

      Questions

      • Is this a known issue?
      • Is there an officially recommended way to make temporary kit toolchain resolution deterministic?
      • Is there any supported preset field to force Qt Creator to use a specific auto-detected toolchain for temporary kits?

      cbaa757c-dbe4-4516-b303-b13f7b3f404f-image.png

      CMakePresets.json

      {
        "version": 5,
        "cmakeMinimumRequired": { "major": 3, "minor": 30, "patch": 0 },
        "configurePresets": [
          {
            "name": "android-base",
            "hidden": true,
            "generator": "Ninja",
            "binaryDir": "${sourceDir}/build/${presetName}",
            "cacheVariables": {
              "VCPKG_MANIFEST_MODE": "ON",
              "ANDROID_SDK_ROOT": "$env{ANDROID_SDK_ROOT}"
            }
          },
          {
            "name": "android-armv7-release",
            "displayName": "Android ARMv7 Release (armeabi-v7a)",
            "inherits": "android-base",
            "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
            "cacheVariables": {
              "CMAKE_BUILD_TYPE": "Release",
              "ANDROID_ABI": "armeabi-v7a",
              "ANDROID_PLATFORM": "android-30",
              "ANDROID_STL": "c++_shared",
       
              "VCPKG_TARGET_TRIPLET": "arm-android-custom",
              "VCPKG_HOST_TRIPLET": "arm64-osx",
              "VCPKG_CHAINLOAD_TOOLCHAIN_FILE":
                "$env{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake",
       
              "CMAKE_PREFIX_PATH": "$env{QT_ANDROID_ARMV7}",
              "Qt6_DIR": "$env{QT_ANDROID_ARMV7}/lib/cmake/Qt6",
      
              "CMAKE_FIND_ROOT_PATH_MODE_PACKAGE": "BOTH"
            }
          },
          {
            "name": "android-armv7-debug",
            "displayName": "Android ARMv7 Debug (armeabi-v7a)",
            "inherits": "android-armv7-release",
            "cacheVariables": {
              "CMAKE_BUILD_TYPE": "Debug"
            }
          },
          {
            "name": "android-arm64-release",
            "displayName": "Android ARM64 Release (arm64-v8a)",
            "inherits": "android-base",
            "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
            "cacheVariables": {
              "CMAKE_BUILD_TYPE": "Release",
              "ANDROID_ABI": "arm64-v8a",
              "ANDROID_PLATFORM": "android-30",
              "ANDROID_STL": "c++_shared",
       
              "VCPKG_TARGET_TRIPLET": "arm64-android-custom",
              "VCPKG_HOST_TRIPLET": "arm64-osx",
              "VCPKG_CHAINLOAD_TOOLCHAIN_FILE":
                "$env{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake",
       
              "CMAKE_PREFIX_PATH": "$env{QT_ANDROID_ARM64}",
              "Qt6_DIR": "$env{QT_ANDROID_ARM64}/lib/cmake/Qt6",
      
              "CMAKE_FIND_ROOT_PATH_MODE_PACKAGE": "BOTH"
            }
          },
          {
            "name": "android-arm64-debug",
            "displayName": "Android ARM64 Debug (arm64-v8a)",
            "inherits": "android-arm64-release",
            "cacheVariables": {
              "CMAKE_BUILD_TYPE": "Debug"
            }
          }
        ],
        "buildPresets": [
          { "name": "android-arm64-release", "configurePreset": "android-arm64-release" },
          { "name": "android-arm64-debug", "configurePreset": "android-arm64-debug" },
          { "name": "android-armv7-release", "configurePreset": "android-armv7-release" },
          { "name": "android-armv7-debug", "configurePreset": "android-armv7-debug" }
        ]
      }
      

      CMakeUserPresets.json

      {
        "version": 5,
        "configurePresets": [
          {
            "name": "user-android-base",
            "hidden": true,
            "environment": {
              "ANDROID_SDK_ROOT": "/Users/techalp/Android",
              "ANDROID_NDK_HOME": "/Users/techalp/Android/ndk/27.2.12479018",
              "VCPKG_ROOT": "/Users/techalp/vcpkg",
              "QT_ANDROID_ARMV7": "/Users/techalp/Qt/6.10.1/android_armv7",
              "QT_ANDROID_ARM64": "/Users/techalp/Qt/6.10.1/android_arm64_v8a",
              "QT_HOST_PATH": "/Users/techalp/Qt/6.10.1/macos"
            },
            "cacheVariables": {
              "CMAKE_MAKE_PROGRAM": "/opt/homebrew/bin/ninja"
            }
          },
          {
            "name": "user-android-arm64-base",
            "hidden": true,
            "inherits": "user-android-base",
            "cacheVariables": {
              "CMAKE_PREFIX_PATH": "/Users/techalp/Qt/6.10.1/android_arm64_v8a",
              "Qt6_DIR": "/Users/techalp/Qt/6.10.1/android_arm64_v8a/lib/cmake/Qt6",
              "QT_QMAKE_EXECUTABLE": "/Users/techalp/Qt/6.10.1/android_arm64_v8a/bin/qmake6",
              "CMAKE_FIND_ROOT_PATH": "/Users/techalp/Qt/6.10.1/android_arm64_v8a"
            }
          },
          {
            "name": "user-android-armv7-base",
            "hidden": true,
            "inherits": "user-android-base",
            "cacheVariables": {
              "CMAKE_PREFIX_PATH": "/Users/techalp/Qt/6.10.1/android_armv7",
              "Qt6_DIR": "/Users/techalp/Qt/6.10.1/android_armv7/lib/cmake/Qt6",
              "QT_QMAKE_EXECUTABLE": "/Users/techalp/Qt/6.10.1/android_armv7/bin/qmake6",
              "CMAKE_FIND_ROOT_PATH": "/Users/techalp/Qt/6.10.1/android_armv7"
            }
          },
          {
            "name": "user-android-arm64-debug",
            "displayName": "User Android ARM64 Debug",
            "inherits": ["user-android-arm64-base", "android-arm64-debug"]
          },
          {
            "name": "user-android-arm64-release",
            "displayName": "User Android ARM64 Release",
            "inherits": ["user-android-arm64-base", "android-arm64-release"]
          },
          {
            "name": "user-android-armv7-debug",
            "displayName": "User Android ARMv7 Debug",
            "inherits": ["user-android-armv7-base", "android-armv7-debug"]
          },
          {
            "name": "user-android-armv7-release",
            "displayName": "User Android ARMv7 Release",
            "inherits": ["user-android-armv7-base", "android-armv7-release"]
          }
        ],
        "buildPresets": [
          { "name": "user-android-arm64-debug", "configurePreset": "user-android-arm64-debug" },
          { "name": "user-android-arm64-release", "configurePreset": "user-android-arm64-release" },
          { "name": "user-android-armv7-debug", "configurePreset": "user-android-armv7-debug" },
          { "name": "user-android-armv7-release", "configurePreset": "user-android-armv7-release" }
        ]
      }
      
      cristian-adamC Offline
      cristian-adamC Offline
      cristian-adam
      wrote last edited by
      #2

      @Enes-Alp This is very good documented. You could easily create a bug report from it.

      A bug report would help me with reporting 😀

      Qt Creator creates for every CMake preset a small CMake probe project in oder to figure out the compiler and the environment.

      These probes exist until the project is configured, that is you click on the Configure Project button.

      You can get information about these probe importing by setting the environment variable QT_LOGGING_RULES=qtc.cmake.import=true.

      What I usually do with Qt Creator's own CMake presets ... I do a Build > Reload CMake Presets which would delete existing Kits and re-create them. Sometimes it helps to get things unstuck.

      1 Reply Last reply
      1
      • E Offline
        E Offline
        Enes Alp
        wrote last edited by
        #3

        thanks @cristian-adam, i created a bug report.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved