Skip to content

[Bug] ${buildKitTargetArch} is 'unknown' for Visual Studio Kits #4560

@gerardcarbo

Description

@gerardcarbo

Brief Issue Summary

When using ${buildKitTargetArch} as Variable substitution in Build Directory (${workspaceFolder}/build/${buildKitTargetArch}) for Visual Studio Kits (tested in Visual Studio Professional 2019 and 2022 Release) the created folder is 'build/unknown' for all target architectures:

Image

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.103.1",
  "cmtVersion": "1.22.7",
  "configurations": [
    {
      "folder": "e:\\DeltaIdPlus\\OCR\\cpp",
      "cmakeVersion": "4.1.1",
      "configured": false,
      "generator": "Visual Studio 17 2022",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Configuring project: cmaketest 
[main] Saving open files before configure/build
[expand] expanded ${workspaceFolder}/build/${buildKitTargetArch}
[driver] Start configure 
[driver] Running pre-configure checks and steps
[expand] expanded ${workspaceFolder}/build/${buildKitTargetArch}
[cmakefileapi-driver] Configuring using kit
[cmakefileapi-driver] Invoking CMake C:\Program Files\CMake\bin\cmake.exe with arguments ["-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE","--no-warn-unused-cli","-S","E:/cmaketest","-B","e:/cmaketest/build/unknown","-G","Visual Studio 17 2022","-T","host=x64","-A","x64"]
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.exe" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -S E:/cmaketest -B e:/cmaketest/build/unknown -G "Visual Studio 17 2022" -T host=x64 -A x64
[proc]   with environment: {"windir":"C:\\WINDOWS"}
[cmake] CMake Warning (dev) in CMakeLists.txt:
[cmake]   No project() command is present.  The top-level CMakeLists.txt file must
[cmake]   contain a literal, direct call to the project() command.  Add a line of
[cmake]   code such as
[cmake] 
[cmake]     project(ProjectName)
[cmake] 
[cmake]   near the top of the file, but after cmake_minimum_required().
[cmake] 
[cmake]   CMake is pretending there is a "project(Project)" command on the first
[cmake]   line.
[cmake] This warning is for project developers.  Use -Wno-dev to suppress it.
[cmake] 
[cmake] CMake Warning (dev) in CMakeLists.txt:
[cmake]   cmake_minimum_required() should be called prior to this top-level project()
[cmake]   call.  Please see the cmake-commands(7) manual for usage documentation of
[cmake]   both commands.
[cmake] This warning is for project developers.  Use -Wno-dev to suppress it.
[cmake] 
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Configuring done (0.0s)
[cmake] -- Generating done (0.0s)
[cmake] -- Build files have been written to: E:/cmaketest/build/unknown
[cmakefileapi-parser] Read reply folder: e:\cmaketest\build\unknown\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-601efeae2835cb0cd94f.json","cmakeFiles-v1-7c2c6f222de125540abf.json","codemodel-v2-abef0fa53ac10be45b2d.json","directory-.-Debug-d0094a50bb2071803777.json","directory-.-MinSizeRel-d0094a50bb2071803777.json","directory-.-Release-d0094a50bb2071803777.json","directory-.-RelWithDebInfo-d0094a50bb2071803777.json","index-2025-08-29T08-35-50-0185.json","target-ALL_BUILD-Debug-21b93cdebeda8b7eaff2.json","target-ALL_BUILD-MinSizeRel-21b93cdebeda8b7eaff2.json","target-ALL_BUILD-Release-21b93cdebeda8b7eaff2.json","target-ALL_BUILD-RelWithDebInfo-21b93cdebeda8b7eaff2.json","target-ZERO_CHECK-Debug-a51371a7c25be58acdcf.json","target-ZERO_CHECK-MinSizeRel-a51371a7c25be58acdcf.json","target-ZERO_CHECK-Release-a51371a7c25be58acdcf.json","target-ZERO_CHECK-RelWithDebInfo-a51371a7c25be58acdcf.json","toolchains-v1-07df8119f147e128ca2e.json"]
[kit] VS installation instance not found for kit "Visual Studio Professional 2022 Release - amd64" - (7649b17b). It is recommended you re-scan the kits and also remove any user-local entries that are not present anymore on the system.
[cache] Reading CMake cache file e:/cmaketest/build/unknown/CMakeCache.txt
[cache] Parsing CMake cache string

Additional Information

No response

Metadata

Metadata

Labels

buga bug in the product

Type

No type

Projects

Status

Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions