microsoft / microsoft/vscode-cmake-tools
[Bug] configurePresets not work
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
### Brief Issue Summary
When I tried to create a new project according to 'CMake: Quick Start', 'configurationSets' did not take effect
### CMake Tools Diagnostics
```shell
{
"os": "win32",
"vscodeVersion": "1.98.2",
"cmtVersion": "1.20.53",
"configurations": [
{
"folder": "e:\\test1",
"cmakeVersion": "4.0.0",
"configured": true,
"generator": "Ninja",
"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": false
}
]
}
```
### Debug Log
```shell
[proc] Executing command: "D:\Program Files\CMake\bin\cmake.exe" --version
[proc] Executing command: "D:\Program Files\CMake\bin\cmake.exe" -E capabilities
[main] Safe constructing new CMakeProject instance
[variant] Constructing VariantManager
[main] Constructing new CMakeProject instance
[main] Starting CMake Tools second-phase init
[expand] expanded ${workspaceFolder}
[kit] Reading kits file C:\Users\Sharper6464\AppData\Local\CMakeTools\cmake-tools-kits.json
[kit] Successfully loaded 10 kits from C:\Users\Sharper6464\AppData\Local\CMakeTools\cmake-tools-kits.json
[kit] Not reading non-existent kits file: e:\test1\.vscode\cmake-kits.json
[variant] Loaded new set of variants
[main] CMakeProject instance initialization complete.
[extension] [8706] cmake.quickStart started
[main] Injecting new Kit into CMake driver
[main] Starting new CMake driver
[main] Starting CMake driver
[main] Using generator from user configuration: Ninja
[cmakefileapi-driver] Creating instance of CMakeFileApiDriver
[driver] Initializing base driver using kit
[driver] CMakeDriver Kit set to __unspec__
[kit] The environment for kit '__unspec__': {
"ALLUSERSPROFILE": "C:\\ProgramData",
"APPDATA": "C:\\Users\\Sharper6464\\AppData\\Roaming",
"CHROME_CRASHPAD_PIPE_NAME": "\\\\.\\pipe\\crashpad_9260_UGMVJVNJAYPWHVEK",
"COMPUTERNAME": "DESKTOP-6LQ9UM9",
"ComSpec": "C:\\WINDOWS\\system32\\cmd.exe",
"CommonProgramFiles": "C:\\Program Files\\Common Files",
"CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
"CommonProgramW6432": "C:\\Program Files\\Common Files",
"DriverData": "C:\\Windows\\System32\\Drivers\\DriverData",
"EFC_6184": "1",
"ELECTRON_RUN_AS_NODE": "1",
"GNUPGHOME": "C:\\Users\\Sharper6464\\AppData\\Roaming\\gnupg",
"GNUPLOT_LIB": "D:\\Program Files\\gnuplot\\demo;D:\\Program Files\\gnuplot\\demo\\games;D:\\Program Files\\gnuplot\\share",
"GOOGLE_API_KEY": "no",
"GOOGLE_DEFAULT_CLIENT_ID": "no",
"GOOGLE_DEFAULT_CLIENT_SECRET": "no",
"HOMEDRIVE": "C:",
"HOMEPATH": "\\Users\\Sharper6464",
"LOCALAPPDATA": "C:\\Users\\Sharper6464\\AppData\\Local",
"LOGONSERVER": "\\\\DESKTOP-6LQ9UM9",
"NUMBER_OF_PROCESSORS": "4",
"ORIGINAL_XDG_CURRENT_DESKTOP": "undefined",
"OS": "Windows_NT",
"OneDrive": "C:\\Users\\Sharper6464\\OneDrive",
"PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC",
"PROCESSOR_ARCHITECTURE": "AMD64",
"PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 165 Stepping 5, GenuineIntel",
"PROCESSOR_LEVEL": "6",
"PROCESSOR_REVISION": "a505",
"PSModulePath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules",
"PUBLIC": "C:\\Users\\Public",
"Path": "D:\\Program Files\\Eclipse Adoptium\\jdk-21.0.6.7-hotspot\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;D:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files (x86)\\Microsoft\\Edge\\Application;D:\\Program Files\\chrome-win64;C:\\Program Files\\Mozilla Firefox;D:\\Program Files (x86)\\Gpg4win\\..\\GnuPG\\bin;D:\\Program Files\\Git\\cmd;D:\\Program Files\\Bandizip\\;D:\\Program Files\\upx-5.0.0-win64;D:\\Program Files\\ffmpeg-7.1.1-full_build\\bin;D:\\Program Files\\BinDiff\\bin;D:\\Strawberry\\perl\\site\\bin;D:\\Strawberry\\perl\\bin;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;D:\\Program Files\\CMake\\bin;D:\\Program Files\\ninja-win;C:\\Users\\Sharper6464\\.local\\bin;C:\\Users\\Sharper6464\\AppData\\Local\\Programs\\Python\\Python313\\Scripts\\;C:\\Users\\Sharper6464\\AppData\\Local\\Programs\\Python\\Python313\\;C:\\Users\\Sharper6464\\AppData\\Local\\Programs\\Python\\Launcher\\;C:\\Users\\Sharper6464\\AppData\\Local\\Microsoft\\WindowsApps;D:\\Program Files\\Fiddler;D:\\Program Files (x86)\\Nmap",
"ProgramData": "C:\\ProgramData",
"ProgramFiles": "C:\\Program Files",
"ProgramFiles(x86)": "C:\\Program Files (x86)",
"ProgramW6432": "C:\\Program Files",
"SESSIONNAME": "Console",
"SystemDrive": "C:",
"SystemRoot": "C:\\WINDOWS",
"TEMP": "C:\\Users\\SHARPE~1\\AppData\\Local\\Temp",
"TMP": "C:\\Users\\SHARPE~1\\AppData\\Local\\Temp",
"USERDOMAIN": "DESKTOP-6LQ9UM9",
"USERDOMAIN_ROAMINGPROFILE": "DESKTOP-6LQ9UM9",
"USERNAME": "Sharper6464",
"USERPROFILE": "C:\\Users\\Sharper6464",
"UV_DEFAULT_INDEX": "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple",
"VSCODE_CODE_CACHE_PATH": "C:\\Users\\Sharper6464\\AppData\\Roaming\\Code\\CachedData\\ddc367ed5c8936efe395cffeec279b04ffd7db78",
"VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost",
"VSCODE_CWD": "E:\\test1",
"VSCODE_ESM_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
"VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
"VSCODE_IPC_HOOK": "\\\\.\\pipe\\06abd3ac-1.98.2-main-sock",
"VSCODE_NLS_CONFIG": "{\"userLocale\":\"en\",\"osLocale\":\"zh-cn\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"D:\\\\Program Files\\\\Microsoft VS Code\\\\resources\\\\app\\\\out\\\\nls.messages.json\",\"locale\":\"en\",\"availableLanguages\":{}}",
"VSCODE_PID": "9260",
"windir": "C:\\WINDOWS"
}
[expand] expanded ${workspaceFolder}/build
[driver] Setting new variant Debug
[expand] expanded ${workspaceFolder}/build
[main] [Quick Start] CmakeLists.txt created successfully.
[presetController] Start selection of configure presets. Found 0 presets.
[presetController] Opening configure preset selection QuickPick
[presetController] Start selection of compilers. Found 12 compilers.
[presetController] Opening compiler selection QuickPick
[presetController] User selected compiler {"label":"Clang 20.1.0 x86_64-pc-windows-msvc","description":"Using compilers: C = D:\\Program Files\\clang-llvm-20.1.0-x86_64\\bin\\clang.exe, CXX = D:\\Program Files\\clang-llvm-20.1.0-x86_64\\bin\\clang++.exe","kit":{"name":"Clang 20.1.0 x86_64-pc-windows-msvc","compilers":{"C":"D:\\Program Files\\clang-llvm-20.1.0-x86_64\\bin\\clang.exe","CXX":"D:\\Program Files\\clang-llvm-20.1.0-x86_64\\bin\\clang++.exe"},"isTrusted":true}}
[presetController] Reading presets file E:\test1\CMakePresets.json
[presetController] Reading and validating the presets "file E:\test1\CMakePresets.json"
[presetController] Successfully validated E:\test1\CMakePresets.json against presets schema
[presetController] Expanding presets file E:\test1\CMakePresets.json
[expand] expanded ${sourceDir}/out/build/${presetName}
[expand] expanded ${sourceDir}/out/install/${presetName}
[presetController] Successfully expanded presets file E:\test1\CMakePresets.json
[presetController] Reading presets file E:\test1\CMakePresets.json
[presetController] Reading and validating the presets "file E:\test1\CMakePresets.json"
[presetController] Successfully validated E:\test1\CMakePresets.json against presets schema
[presetController] Expanding presets file E:\test1\CMakePresets.json
[expand] expanded ${sourceDir}/out/build/${presetName}
[expand] expanded ${sourceDir}/out/install/${presetName}
[presetController] Successfully expanded presets file E:\test1\CMakePresets.json
[presetController] User selected configure preset "Clang 20.1.0 x86_64-pc-windows-msvc"
[main] Resolving the selected configure preset
[expand] expanded ${sourceDir}/out/build/${presetName}
[expand] expanded ${sourceDir}/out/install/${presetName}
[main] Loading new configure preset into CMake driver
[driver] Switching to configure preset: Clang 20.1.0 x86_64-pc-windows-msvc
[driver] CMakeDriver configure preset set to Clang 20.1.0 x86_64-pc-windows-msvc
[driver] No generator specified
[main] Resolving the selected build preset
[main] Using generator from user configuration: Ninja
[extension] Not updating the configuration provider because "C_Cpp.intelliSenseEngine" is set to "Disabled"
[main] Loading new build preset into CMake driver
[driver] Switching to build preset: __defaultBuildPreset__
[driver] CMakeDriver build preset set to __defaultBuildPreset__
[main] Resolving the selected test preset
[main] Resolving the selected test preset
[main] Using generator from user configuration: Ninja
[main] Loading new test preset into CMake driver
[driver] Switching to test preset: __defaultTestPreset__
[driver] CMakeDriver test preset set to __defaultTestPreset__
[main] Resolving the selected package preset
[main] Resolving the selected package preset
[main] Using generator from user configuration: Ninja
[main] Loading new package preset into CMake driver
[driver] Switching to package preset: __defaultPackagePreset__
[driver] CMakeDriver package preset set to __defaultPackagePreset__
[main] Resolving the selected workflow preset
[main] Resolving the selected workflow preset
[expand] expanded ${sourceDir}/out/build/${presetName}
[expand] expanded ${sourceDir}/out/install/${presetName}
[main] Loading new workflow preset into CMake driver
[driver] Switching to workflow preset: __defaultWorkflowPreset__
[driver] CMakeDriver workflow preset set to __defaultWorkflowPreset__
[main] [Quick Start] CMakePresets.json created successfully.
[main] Configuring project: test1
[main] Saving open files before configure/build
[expand] expanded ${workspaceFolder}/build
[driver] Start configure
[driver] Running pre-configure checks and steps
[expand] expanded ${workspaceFolder}/build
[cmakefileapi-driver] Configuring using kit
[cmakefileapi-driver] Invoking CMake D:\Program Files\CMake\bin\cmake.exe with arguments ["-DCMAKE_BUILD_TYPE:STRING=Debug","-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE","--no-warn-unused-cli","-SE:/test1","-Be:/test1/build","-G","Ninja"]
[proc] Executing command: "D:\Program Files\CMake\bin\cmake.exe" -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -SE:/test1 -Be:/test1/build -G Ninja
[proc] with environment: {"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\Sharper6464\\AppData\\Roaming","CHROME_CRASHPAD_PIPE_NAME":"\\\\.\\pipe\\crashpad_9260_UGMVJVNJAYPWHVEK","COMPUTERNAME":"DESKTOP-6LQ9UM9","ComSpec":"C:\\WINDOWS\\system32\\cmd.exe","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","EFC_6184":"1","ELECTRON_RUN_AS_NODE":"1","GNUPGHOME":"C:\\Users\\Sharper6464\\AppData\\Roaming\\gnupg","GNUPLOT_LIB":"D:\\Program Files\\gnuplot\\demo;D:\\Program Files\\gnuplot\\demo\\games;D:\\Program Files\\gnuplot\\share","GOOGLE_API_KEY":"no","GOOGLE_DEFAULT_CLIENT_ID":"no","GOOGLE_DEFAULT_CLIENT_SECRET":"no","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\Sharper6464","LOCALAPPDATA":"C:\\Users\\Sharper6464\\AppData\\Local","LOGONSERVER":"\\\\DESKTOP-6LQ9UM9","NUMBER_OF_PROCESSORS":"4","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","OS":"Windows_NT","OneDrive":"C:\\Users\\Sharper6464\\OneDrive","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 165 Stepping 5, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"a505","PSModulePath":"C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules","PUBLIC":"C:\\Users\\Public","Path":"D:\\Program Files\\Eclipse Adoptium\\jdk-21.0.6.7-hotspot\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;D:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files (x86)\\Microsoft\\Edge\\Application;D:\\Program Files\\chrome-win64;C:\\Program Files\\Mozilla Firefox;D:\\Program Files (x86)\\Gpg4win\\..\\GnuPG\\bin;D:\\Program Files\\Git\\cmd;D:\\Program Files\\Bandizip\\;D:\\Program Files\\upx-5.0.0-win64;D:\\Program Files\\ffmpeg-7.1.1-full_build\\bin;D:\\Program Files\\BinDiff\\bin;D:\\Strawberry\\perl\\site\\bin;D:\\Strawberry\\perl\\bin;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;D:\\Program Files\\CMake\\bin;D:\\Program Files\\ninja-win;C:\\Users\\Sharper6464\\.local\\bin;C:\\Users\\Sharper6464\\AppData\\Local\\Programs\\Python\\Python313\\Scripts\\;C:\\Users\\Sharper6464\\AppData\\Local\\Programs\\Python\\Python313\\;C:\\Users\\Sharper6464\\AppData\\Local\\Programs\\Python\\Launcher\\;C:\\Users\\Sharper6464\\AppData\\Local\\Microsoft\\WindowsApps;D:\\Program Files\\Fiddler;D:\\Program Files (x86)\\Nmap","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","SESSIONNAME":"Console","SystemDrive":"C:","SystemRoot":"C:\\WINDOWS","TEMP":"C:\\Users\\SHARPE~1\\AppData\\Local\\Temp","TMP":"C:\\Users\\SHARPE~1\\AppData\\Local\\Temp","USERDOMAIN":"DESKTOP-6LQ9UM9","USERDOMAIN_ROAMINGPROFILE":"DESKTOP-6LQ9UM9","USERNAME":"Sharper6464","USERPROFILE":"C:\\Users\\Sharper6464","UV_DEFAULT_INDEX":"https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple","VSCODE_CODE_CACHE_PATH":"C:\\Users\\Sharper6464\\AppData\\Roaming\\Code\\CachedData\\ddc367ed5c8936efe395cffeec279b04ffd7db78","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"E:\\test1","VSCODE_ESM_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"\\\\.\\pipe\\06abd3ac-1.98.2-main-sock","VSCODE_L10N_BUNDLE_LOCATION":"","VSCODE_NLS_CONFIG":"{\"userLocale\":\"en\",\"osLocale\":\"zh-cn\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"D:\\\\Program Files\\\\Microsoft VS Code\\\\resources\\\\app\\\\out\\\\nls.messages.json\",\"locale\":\"en\",\"availableLanguages\":{}}","VSCODE_PID":"9260","windir":"C:\\WINDOWS"}
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_C_COMPILER could be found.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
[cmake] the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_CXX_COMPILER could be found.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
[cmake] to the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: "D:\Program Files\CMake\bin\cmake.exe" -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -SE:/test1 -Be:/test1/build -G Ninja exited with code: 1
[extension] [8706] cmake.quickStart finished (returned 1)
```
### Additional Information
A video demonstration
https://github.com/user-attachments/assets/129a214c-2cbd-4bc6-ad69-2587fb62cf87
Contributor guide
Research direction
Start with the CMake: Quick Start entry point and the presetController flow shown in the logs, using the generated CMakePresets.json to reproduce the issue on Windows. Compare the selected configure preset with the subsequent configure command and confirm that the selected preset's settings, rather than the workspace build configuration, take effect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100