{"id":25503,"date":"2020-02-06T21:17:53","date_gmt":"2020-02-06T21:17:53","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=25503"},"modified":"2020-02-06T21:21:26","modified_gmt":"2020-02-06T21:21:26","slug":"code-navigation-for-cmake-scripts","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/code-navigation-for-cmake-scripts\/","title":{"rendered":"Code Navigation for CMake Scripts"},"content":{"rendered":"<p><a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">Visual Studio 2019 16.5 Preview 2<\/a> makes it easy to make sense of complex CMake projects. Code navigation features such as Go To Definition and Find All References are now supported for <strong>variables, functions, and targets<\/strong> in CMake script files. This can be a huge timesaver because CMake projects with more than a handful of source files are often organized into several CMake scripts to encapsulate each part of the project.<\/p>\n<p>These navigation features work across your entire CMake project to offer more productivity than na\u00efve text search across files and folders. They are also integrated with other IDE productivity features such as <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-view-and-edit-code-by-using-peek-definition-alt-plus-f12?view=vs-2019\">Peek Definition<\/a>.<\/p>\n<p><strong>Go To Definition:<\/strong><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-25505\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Peek-Small.png\" alt=\"Go To Definition with Peek on a CMake variable.\" width=\"1023\" height=\"558\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Peek-Small.png 1023w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Peek-Small-300x164.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Peek-Small-768x419.png 768w\" sizes=\"(max-width: 1023px) 100vw, 1023px\" \/><\/p>\n<p><strong>Find All References:<\/strong><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-25506\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Find-All-Refs.png\" alt=\"Find All References working across a CMake project.\" width=\"1367\" height=\"576\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Find-All-Refs.png 1367w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Find-All-Refs-300x126.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Find-All-Refs-1024x431.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Find-All-Refs-768x324.png 768w\" sizes=\"(max-width: 1367px) 100vw, 1367px\" \/><\/p>\n<p>You can configure the in-editor documentation and navigation features for CMake scripts in Tools &gt; Options &gt; CMake &gt; Language Services:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-25504\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Options.png\" alt=\"CMake script language service settings in \u201cTools &gt; Options &gt; CMake &gt; Language Services\u201d.\" width=\"1133\" height=\"710\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Options.png 1133w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Options-300x188.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Options-1024x642.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/02\/CMake-Lang-Services-Options-768x481.png 768w\" sizes=\"(max-width: 1133px) 100vw, 1133px\" \/><\/p>\n<h3>Send Us Feedback<\/h3>\n<p>Please try out the\u00a0<a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">latest preview<\/a>\u00a0and let us know if you have any feedback. It is always appreciated! The best way to get in touch with us about an issue or suggestion is though Developer Community with the \u201c<a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio\">Report a Problem<\/a>\u201d or \u201cSuggest a Feature\u201d tools. This makes it easy for us to follow up and for you to get the latest updates about our progress. Feel free to comment here or send an email to\u00a0<a href=\"mailto:cmake@microsoft.com\">cmake@microsoft.com<\/a>\u00a0with questions as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio 2019 16.5 Preview 2 makes it easy to make sense of complex CMake projects. Code navigation features such as Go To Definition and Find All References are now supported for variables, functions, and targets in CMake script files. This can be a huge timesaver because CMake projects with more than a handful of [&hellip;]<\/p>\n","protected":false},"author":326,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,266],"tags":[8,252],"class_list":["post-25503","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","category-cmake","tag-announcement","tag-cmake"],"acf":[],"blog_post_summary":"<p>Visual Studio 2019 16.5 Preview 2 makes it easy to make sense of complex CMake projects. Code navigation features such as Go To Definition and Find All References are now supported for variables, functions, and targets in CMake script files. This can be a huge timesaver because CMake projects with more than a handful of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/25503","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\/326"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=25503"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/25503\/revisions"}],"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=25503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=25503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=25503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}