{"id":653,"date":"2022-06-16T06:44:54","date_gmt":"2022-06-16T06:44:54","guid":{"rendered":"https:\/\/tbekk.com\/devstream\/?p=653"},"modified":"2022-06-16T06:46:07","modified_gmt":"2022-06-16T06:46:07","slug":"whats-new-in-cmake-for-vs-code","status":"publish","type":"post","link":"https:\/\/tbekk.com\/devstream\/2022\/06\/16\/whats-new-in-cmake-for-vs-code\/","title":{"rendered":"What\u2019s New in CMake for VS Code"},"content":{"rendered":"\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<ul class=\"wp-block-list\"><li><em><strong>Link: <\/strong><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/whats-new-in-cmake-for-vs-code\/\">https:\/\/www.rstudio.com\/blog\/announcing-rstudio-for-azure-ml\/<\/a><\/em><\/li><li><em><strong>Publication date:<\/strong> Wednesday June 15th, 2022<\/em><\/li><li><em><strong>Author:<\/strong> <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/author\/sinemakinci\">Sinem Akinci<\/a><\/em><\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<p>The latest version of CMake tools is now&nbsp;<a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/releases\/tag\/v1.11.26\" target=\"_blank\" rel=\"noreferrer noopener\">available for download<\/a>&nbsp;in the VS Code Marketplace or using the .vsix file. We have been working hard on improving the CMake experience and are excited to share some new features and improvements for users starting in version 1.11.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"cmake-task-provider-updates\"><strong>\u2018CMake\u2019 task provider updates<\/strong>&nbsp;<\/h4>\n\n\n\n<p>We have added more options to the build task and more commands for the \u201ccmake\u201d task type so you don\u2019t have to manually type up shell tasks. Tasks make it easier to automate your workflows. With our new task provider commands, you can easily create workflows that include configuration, build, install, test, clean, and clean rebuild tasks.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"selecting-targets-now-supported\"><em>Selecting targets now supported<\/em><\/h5>\n\n\n\n<p>Now, in your build task, users can specify&nbsp;multiple&nbsp;targets&nbsp;and it is included as a parameter in the task template.&nbsp;Before, this was a single active target selected in the status bar.&nbsp;Now, you can select any target independent of the state of the extension. An example of a build task to target multiple targets (\u201cmain\u201d and \u201csum\u201d) using this feature is seen below.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-130429.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-130429.png\" alt=\"Example CMake build task with multiple targets\" class=\"wp-image-30659\"\/><\/a><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"new-cmake-tasks-supported\"><em>New CMake tasks supported<\/em><\/h5>\n\n\n\n<p>To run and configure tasks, press&nbsp;<code>Ctrl+Shift+P<\/code>&nbsp;to pull up the Command Palette&nbsp;and select the&nbsp;appropriate option&nbsp;for your tasks.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-130904.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-130904.png\" alt=\"Command Palette drop-down with CMake tasks selected\" class=\"wp-image-30660\"\/><\/a><\/figure>\n\n\n\n<p>To create a new task, first select \u201cConfigure Task\u201d from the dropdown. This will populate the view below in a C++ project.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-131342.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-131342.png\" alt=\"CMake tasks that the user can select to configure\" class=\"wp-image-30662\"\/><\/a><\/figure>\n\n\n\n<p>You can select the&nbsp;appropriate task, which will populate the task template in the&nbsp;tasks.json&nbsp;file.&nbsp;&nbsp;We recommend updating the \u201cdetail\u201d&nbsp;field in the JSON object for your CMake tasks&nbsp;so that you can differentiate the tasks from the drop-down.&nbsp;<\/p>\n\n\n\n<p>Once the task is created, you can select this task to run using \u201cRun Task\u201d from the Command Palette,&nbsp;which will run the shell commands for the created task.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-133234.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/Screenshot-2022-06-14-133234.png\" alt=\"Example CMake tasks to select to run\" class=\"wp-image-30665\"\/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"coming-soon\">Coming Soon<\/h4>\n\n\n\n<p>We are working to add even more support for the \u2018CMake\u2019 task provider, including adding&nbsp;\u201cargs\u201d&nbsp;and&nbsp;\u201cenvironment\u201d&nbsp;specification for your tasks.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"what-do-you-think\">What do you think?<\/h4>\n\n\n\n<p>Download the&nbsp;<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cmake-tools\" target=\"_blank\" rel=\"noreferrer noopener\">CMake&nbsp;Tools extension&nbsp;<\/a>for Visual Studio Code&nbsp;and let us know what you think. If you run into any issues or have any suggestions, please report them in the&nbsp;<a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/issues\" target=\"_blank\" rel=\"noreferrer noopener\">Issues section of our GitHub repository<\/a>. We would love to hear how you are using CMake tasks. Comment&nbsp;below,&nbsp;or&nbsp;reach us&nbsp;via&nbsp;email at&nbsp;<a href=\"mailto:visualcpp@microsoft.com\" target=\"_blank\" rel=\"noreferrer noopener\">visualcpp@microsoft.com<\/a>&nbsp;or via&nbsp;Twitter at&nbsp;<a href=\"https:\/\/twitter.com\/visualc\" target=\"_blank\" rel=\"noreferrer noopener\">@VisualC<\/a>.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Link: https:\/\/www.rstudio.com\/blog\/announcing-rstudio-for-azure-ml\/ Publication date: Wednesday June 15th, 2022 Author: Sinem Akinci The latest version of CMake tools is now&nbsp;available for download&nbsp;in the VS Code Marketplace or using the .vsix file&#8230;. <a class=\"read-more-link\" href=\"https:\/\/tbekk.com\/devstream\/2022\/06\/16\/whats-new-in-cmake-for-vs-code\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,84,111,9],"tags":[96,149,105],"class_list":["post-653","post","type-post","status-publish","format-standard","hentry","category-article","category-build","category-dev-tools","category-news","tag-cmake","tag-visual-studio-code","tag-vs-code"],"_links":{"self":[{"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/posts\/653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":3,"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"predecessor-version":[{"id":656,"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/posts\/653\/revisions\/656"}],"wp:attachment":[{"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tbekk.com\/devstream\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}