{"id":37004,"date":"2026-09-25T22:38:54","date_gmt":"2026-09-25T22:38:54","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=37004"},"modified":"2026-09-25T22:38:54","modified_gmt":"2026-09-25T22:38:54","slug":"visual-studio-code-cmake-tools-1-24","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-code-cmake-tools-1-24\/","title":{"rendered":"Visual Studio Code CMake Tools 1.24"},"content":{"rendered":"<p>CMake Tools 1.24 includes several reliability fixes and productivity improvements. You can run tests from the editor, save preset-backed cache edits as user overrides, and keep source-file lists up to date. See the <a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/releases\">CMake Tools release page<\/a> and <a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/blob\/main\/CHANGELOG.md\">full changelog<\/a> for details.<\/p>\n<p>Thank you to the community contributors whose work is included in these updates:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/4884\">Preset-aware cache editing<\/a>, from <a href=\"https:\/\/github.com\/BilboBeutlin89\">@BilboBeutlin89<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/4881\">Building targets needed by selected tests<\/a>, based on <a href=\"https:\/\/github.com\/epistax\">Brian Cody&#8217;s<\/a> <a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/4523\">original contribution<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/4627\">Compiler arguments for IntelliSense with CMake 4.3+<\/a>, from <a href=\"https:\/\/github.com\/cwalther\">Christian Walther<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/4908\">Responding to CMake path updates from vendor extensions<\/a>, from <a href=\"https:\/\/github.com\/JDESTM\">STMicroelectronics<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/5006\">Running CMake in the project directory for version-manager shims<\/a>, from <a href=\"https:\/\/github.com\/danieleformichelli\">Daniele Formichelli<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/5047\">Clearer crash and timeout messages<\/a>, from <a href=\"https:\/\/github.com\/Om-singhaI\">@Om-singhaI<\/a>.<\/li>\n<\/ul>\n<h2>Run and debug CTest tests from the editor<\/h2>\n<p>Discovered CTest tests with resolved source locations now have <strong>Run<\/strong> and <strong>Debug<\/strong> CodeLens actions in the editor. These complement the existing <strong>Run<\/strong> and <strong>Debug<\/strong> actions and source navigation in the Project Outline. Select <strong>Run<\/strong> above a test to build and execute it without switching to the Testing view.<\/p>\n<p>When the test command maps directly to a CMake executable target, <strong>Run<\/strong> builds that target and its dependencies instead of the default build target.<\/p>\n<p>The example below has separate <code>cart_tests<\/code> and <code>shipping_tests<\/code> executables. Running <code>Cart.AppliesDiscount<\/code> from CodeLens builds <code>cart_tests<\/code> and runs that test, without rebuilding the unrelated <code>shipping_tests<\/code> target.<\/p>\n<p><figure id=\"attachment_37008\" aria-labelledby=\"figcaption_attachment_37008\" class=\"wp-caption aligncenter\" ><a href=\"captures\/gifs\/ctest-codelens.gif\"><img decoding=\"async\" class=\"wp-image-37008\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/09\/run-cart-appliesdiscount-from-codelens-and-build-i-1.gif\" alt=\"Run Cart.AppliesDiscount from CodeLens and build its cart_tests target.\" width=\"1440\" height=\"792\" \/><\/a><figcaption id=\"figcaption_attachment_37008\" class=\"wp-caption-text\">Run <code>Cart.AppliesDiscount<\/code> from CodeLens and build its <code>cart_tests<\/code> target.<\/figcaption><\/figure><\/p>\n<p>For <strong>Debug<\/strong>, build the executable first and have a suitable C++ debugger and debug adapter available. The inline action launches the executable directly, without a build step.<\/p>\n<p>Debugging tests from the Project Outline or Testing view does not require a <code>launch.json<\/code>.<\/p>\n<h2><strong>Keep local cache changes without changing shared presets<\/strong><\/h2>\n<p>A value set in a configure preset can overwrite a manual cache edit on the next configure. The Cache Editor now saves edits to preset-backed variables as overrides in <code>CMakeUserPresets.json<\/code>.<\/p>\n<p>After configuring with a preset, open <strong>CMake: Edit CMake Cache (UI)<\/strong>. The new <strong>Source<\/strong> column shows preset information alongside cache values. For preset-backed entries, it displays a project- or user-preset label and, when a comparison is available, <strong>Matches preset<\/strong> or <strong>Changed in cache<\/strong>. Entries without preset information come from the <strong>CMake Cache<\/strong>.<\/p>\n<p>For example, <code>BUILD_TESTING<\/code> starts <strong>ON<\/strong> in the project&#8217;s <code>cache-demo<\/code> preset. Turn it <strong>OFF<\/strong> and choose <strong>SAVE<\/strong>. CMake Tools writes a user-preset override that inherits cache-demo, then configures with it. The shared <code>CMakePresets.json<\/code> remains unchanged.<\/p>\n<p>In this example, turning <code>BUILD_TESTING<\/code> off excludes the optional <code>cart_tests<\/code> target from the build while keeping <code>checkout_app<\/code>.<\/p>\n<p><figure id=\"attachment_37009\" aria-labelledby=\"figcaption_attachment_37009\" class=\"wp-caption aligncenter\" ><a href=\"captures\/gifs\/cache-editor-presets.gif\"><img decoding=\"async\" class=\"wp-image-37009\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/09\/turn-off-build_testing-keep-checkout_app-and-sav-1.gif\" alt=\"Turn off BUILD_TESTING, keep checkout_app, and save the change as a user-preset override.\" width=\"2000\" height=\"1152\" \/><\/a><figcaption id=\"figcaption_attachment_37009\" class=\"wp-caption-text\">Turn off <code>BUILD_TESTING<\/code>, keep <code>checkout_app<\/code>, and save the change as a user-preset override.<\/figcaption><\/figure><\/p>\n<p>The edited row then shows a user-preset source. Running <strong>CMake: Configure<\/strong> again in the same session keeps <code>BUILD_TESTING<\/code> off. Edits to cache-only variables still go to the cache and are not automatically added to the user preset.<\/p>\n<h2>Keep source-file lists up to date<\/h2>\n<p>When you create or delete a source file in Explorer, CMake Tools can update its entry in <code>CMakeLists.txt<\/code> for you. Thanks to <a href=\"https:\/\/github.com\/malsyned\">@malsyned<\/a> for the <a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/pull\/4454\">original contribution<\/a>.<\/p>\n<p>This assistance applies to supported <code>CMakeLists.txt<\/code> and target arrangements and follows your configured confirmation behavior. The <code>cmake.modifyLists.*<\/code> settings control target selection, variable handling, and confirmation. Review the resulting changes, especially with generated or complex scripts; this is not a general CMake script rewriter.<\/p>\n<p><figure id=\"attachment_37010\" aria-labelledby=\"figcaption_attachment_37010\" class=\"wp-caption aligncenter\" ><a href=\"captures\/gifs\/source-file-management.gif\"><img decoding=\"async\" class=\"wp-image-37010\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/09\/create-and-delete-a-source-file-in-explorer-while-1.gif\" alt=\"Create and delete a source file in Explorer while CMake Tools updates CMakeLists.txt.\" width=\"1600\" height=\"922\" \/><\/a><figcaption id=\"figcaption_attachment_37010\" class=\"wp-caption-text\">Create and delete a source file in Explorer while CMake Tools updates <code>CMakeLists.txt<\/code>.<\/figcaption><\/figure><\/p>\n<h2>What do you think?<\/h2>\n<p>Let us know how these changes work with your CMake projects. You can find <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cmake-tools\">CMake Tools<\/a> and the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">C\/C++ extension<\/a> in the Visual Studio Code Marketplace.<\/p>\n<p>Share feedback by <a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/issues\/\">opening an issue or voting on an existing one<\/a>, or contribute to the <a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\">CMake Tools repository<\/a>. You can also leave a comment below, email <a href=\"mailto:visualcpp@microsoft.com\">visualcpp@microsoft.com<\/a>, or reach us on <a href=\"https:\/\/x.com\/visualc\">X<\/a> or <a href=\"https:\/\/bsky.app\/profile\/msftcpp.bsky.social\">Bluesky<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CMake Tools 1.24 includes several reliability fixes and productivity improvements. You can run tests from the editor, save preset-backed cache edits as user overrides, and keep source-file lists up to date. See the CMake Tools release page and full changelog for details. Thank you to the community contributors whose work is included in these updates: [&hellip;]<\/p>\n","protected":false},"author":220413,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,266,275],"tags":[],"class_list":["post-37004","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","category-cmake","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>CMake Tools 1.24 includes several reliability fixes and productivity improvements. You can run tests from the editor, save preset-backed cache edits as user overrides, and keep source-file lists up to date. See the CMake Tools release page and full changelog for details. Thank you to the community contributors whose work is included in these updates: [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/37004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/220413"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=37004"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/37004\/revisions"}],"predecessor-version":[{"id":37018,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/37004\/revisions\/37018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=37004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=37004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=37004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}