{"id":16096,"date":"2017-06-14T15:46:46","date_gmt":"2017-06-14T22:46:46","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=16096"},"modified":"2019-02-18T17:48:27","modified_gmt":"2019-02-18T17:48:27","slug":"cmake-support-in-visual-studio-whats-new-in-2017-15-3-preview-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/cmake-support-in-visual-studio-whats-new-in-2017-15-3-preview-2\/","title":{"rendered":"CMake support in Visual Studio \u2013 what\u2019s new in 2017 15.3 Preview\u00a02"},"content":{"rendered":"<p>We&#8217;re excited to announce improved CMake and Ninja support in Visual Studio 15.3 Preview 2.\u00a0 In this preview, we have updated CMake from version 3.7.2 to version 3.8 and added improved support for the CMake Ninja generator.\u00a0 Additionally, this preview includes several fixes for community reported bugs.<\/p>\n<p>Please <a href=\"https:\/\/www.visualstudio.com\/vs\/preview\/\">download the preview<\/a> and try out the latest CMake features.\u00a0 If you are just getting started with CMake, follow the link to\u00a0<a href=\"https:\/\/aka.ms\/cmake\">learn more about CMake support in Visual Studio<\/a>.\u00a0 We are looking forward to your feedback.<\/p>\n<h3>CMake Tools Upgraded to use CMake 3.8<\/h3>\n<p>We are trying to keep the version of CMake that is included in Visual Studio fresh as possible so you can use the latest and greatest features in your projects.\u00a0 To achieve that goal, we have upgraded the internal version of CMake the Visual Studio uses from CMake 3.7.2 to CMake 3.8.<\/p>\n<p>You can find the full lists of enhancements in the <a href=\"https:\/\/cmake.org\/cmake\/help\/v3.8\/release\/3.8.html\">CMake 3.8 release notes<\/a> at <a href=\"https:\/\/cmake.org\/\">cmake.org<\/a>.<\/p>\n<h3>Target 64-bit Windows with Ninja<\/h3>\n<p>In the <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/05\/10\/cmake-support-in-visual-studio-whats-new-in-2017-15-3-update\/\">last preview<\/a> we introduced support for the Ninja generator.\u00a0 Visual Studio now supports targeting 64-bit systems as well as 32-bit.\u00a0 The Ninja generator is now selected by default when you create a new CMakeSettings.json:<\/p>\n<pre class=\"prettyprint js\">\n{\n    \/\/ See https:\/\/go.microsoft.com\/\/fwlink\/\/?linkid=834763 for more information about this file.\n    &quot;configurations&quot;: [\n        {\n        &quot;name&quot;: &quot;x86-Debug&quot;,\n        &quot;generator&quot;: &quot;Ninja&quot;,\n        &quot;configurationType&quot; : &quot;Debug&quot;,\n        &quot;referenceContexts&quot;: [ &quot;msvc_x86&quot; ],\n        &quot;buildRoot&quot;:  &quot;${env.LOCALAPPDATA}\\\\CMakeBuild\\\\${workspaceHash}\\\\build\\\\${name}&quot;,\n        &quot;cmakeCommandArgs&quot;:  &quot;&quot;,\n        &quot;buildCommandArgs&quot;: &quot;-v&quot;,\n        &quot;ctestCommandArgs&quot;:  &quot;&quot;\n        },\n        {\n        &quot;name&quot;: &quot;x86-Release&quot;,\n        &quot;generator&quot;: &quot;Ninja&quot;,\n        &quot;configurationType&quot; : &quot;RelWithDebInfo&quot;,\n        &quot;referenceContexts&quot;: [ &quot;msvc_x86&quot; ],\n        &quot;buildRoot&quot;:  &quot;${env.LOCALAPPDATA}\\\\CMakeBuild\\\\${workspaceHash}\\\\build\\\\${name}&quot;,\n        &quot;cmakeCommandArgs&quot;:  &quot;&quot;,\n        &quot;buildCommandArgs&quot;: &quot;-v&quot;,\n        &quot;ctestCommandArgs&quot;:  &quot;&quot;\n        },\n        {\n        &quot;name&quot;: &quot;x64-Debug&quot;,\n        &quot;generator&quot;: &quot;Ninja&quot;,\n        &quot;configurationType&quot; : &quot;Debug&quot;,\n        &quot;referenceContexts&quot;: [ &quot;msvc_x64&quot; ],\n        &quot;buildRoot&quot;:  &quot;${env.LOCALAPPDATA}\\\\CMakeBuild\\\\${workspaceHash}\\\\build\\\\${name}&quot;,\n        &quot;cmakeCommandArgs&quot;:  &quot;&quot;,\n        &quot;buildCommandArgs&quot;: &quot;-v&quot;,\n        &quot;ctestCommandArgs&quot;:  &quot;&quot;\n        },\n        {\n        &quot;name&quot;: &quot;x64-Release&quot;,\n        &quot;generator&quot;: &quot;Ninja&quot;,\n        &quot;configurationType&quot; : &quot;RelWithDebInfo&quot;,\n        &quot;referenceContexts&quot;: [ &quot;msvc_x64&quot; ],\n        &quot;buildRoot&quot;:  &quot;${env.LOCALAPPDATA}\\\\CMakeBuild\\\\${workspaceHash}\\\\build\\\\${name}&quot;,\n        &quot;cmakeCommandArgs&quot;:  &quot;&quot;,\n        &quot;buildCommandArgs&quot;: &quot;-v&quot;,\n        &quot;ctestCommandArgs&quot;:  &quot;&quot;\n        }\n    ]\n}\n<\/pre>\n<p>To update an existing CMakeSettings.json file to use Ninja to build a 64-bit binary, simply update the\u00a0the generator and referenceContexts. \u00a0Or if you haven&#8217;t heavily customized it you can just delete the existing file and let Visual Studio generate a new one for you. \u00a0It will default to the Ninja generator for all builds.<\/p>\n<h3>Bugfixes and Improvements<\/h3>\n<p>You gave us feedback and we listened.\u00a0 Visual Studio 2017 15.3 includes several improvements and addresses bugs reported by the community.\u00a0 The following issues have been fixed as of 2017 15.3 Preview 2:<\/p>\n<ul>\n<li>Wrong configuration is built for CMake installation target under some circumstances.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/49339\/%e7%b5%b1%e5%90%88%e3%81%95%e3%82%8c%e3%81%9fcmake%e3%81%a6opencv-32%e3%82%92%e3%83%92%e3%83%ab%e3%83%88%e6%99%82release%e3%81%ae%e8%a8%ad%e5%ae%9a%e3%81%a6%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e6%93%8d%e4%bd%9c%e3%82%92%e8%a1%8c%e3%81%a3%e3%81%a6%e3%82%82d.html\">49339<\/a><\/li>\n<li>CMake target selector list shows duplicates.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/49056\/cmake-has-multiple-targets-with-the-same-name.html\">49056<\/a>, <a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/49910\/duplicate-cmake-build-and-debug-options-in-folder.html\">49910<\/a><\/li>\n<li>CMakeSettings.json does not expand variables.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/46703\/cmake-variable-expansion.html\">46703<\/a><\/li>\n<li>CMake generation fails if \u201cStandard\u201d is unchecked in \u201cView-&gt;Toolbars\u201d.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/37195\/if-standard-not-in-toolbar-cmake-cannot-generate.html\">37195<\/a><\/li>\n<li>CMAKE_MAKE_PROGRAM variable not defined in CMake tools for Visual Studio.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/46389\/cmake-make-program-is-not-defined-in-vs2017-cmake.html\">46389<\/a><\/li>\n<li>CMake Tools for Visual Studio fail to load when selected as an individual component in the Visual Studio installer.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/46143\/cmake-menu-wont-show-when-using-open-folder.html\">46143<\/a><\/li>\n<li>Environment variables not properly inherited by CMake Tools for Visual Studio.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/24474\/cmake-builds-dont-include-developer-command-prompt.html\">24474<\/a>, <a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/44177\/visual-studio-cant-set-c-environemnt-with-cmake.html\">44177<\/a><\/li>\n<li>CMake tools does not offer a \u201cRebuild\u201d option.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/22318\/cmake-up-to-date-issue.html\">22318<\/a><\/li>\n<li>Cannot specify options to CTest.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/17968\/no-way-to-specify-options-to-be-given-to-ctest.html\">17968<\/a><\/li>\n<li>CTest tests still run if build step fails.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/17949\/ctest-still-runs-after-compilation-failure-using-c.html\">17949<\/a><\/li>\n<li>CMake cache generation can get stuck with no option to cancel.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/13799\/failed-cmake-cache-generation-is-stuck-somewhere-d.html\">13799<\/a><\/li>\n<li>Release builds cannot be debugged due to missing symbols.\n<em>Developer Community: <\/em><a href=\"https:\/\/developercommunity.visualstudio.com\/content\/problem\/13657\/cmake-confusing-debugging-experience-for-release-c.html\">13657<\/a><\/li>\n<\/ul>\n<h3>Send Us Feedback<\/h3>\n<p>To try out the latest and greatest CMake features and give us some early feedback, please download and install the latest\u00a0<a href=\"https:\/\/www.visualstudio.com\/vs\/preview\/\">Visual Studio 2017 Preview<\/a>.\u00a0 As always, we welcome your feedback.\u00a0 Feel free to send any comments through e-mail at\u00a0<a href=\"mailto:cmake@microsoft.com\">cmake@microsoft.com<\/a>, through\u00a0<a href=\"https:\/\/twitter.com\/visualc\">Twitter @visualc<\/a>, or Facebook at\u00a0<a href=\"https:\/\/www.facebook.com\/Microsoft-Visual-Cpp-222043184527264\/\">Microsoft Visual Cpp<\/a>.<\/p>\n<p>If you encounter other problems with Visual Studio 2017 please let us know via\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio-2017\">Report a Problem<\/a>, which is available in both the installer and the IDE itself. \u00a0For suggestions, let us know through\u00a0<a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-2015\/category\/30937-languages-c\">UserVoice<\/a>. We look forward to your feedback!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re excited to announce improved CMake and Ninja support in Visual Studio 15.3 Preview 2.\u00a0 In this preview, we have updated CMake from version 3.7.2 to version 3.8 and added improved support for the CMake Ninja generator.\u00a0 Additionally, this preview includes several fixes for community reported bugs. Please download the preview and try out the [&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":[270,266],"tags":[8,140,252,233,308,6,309,268],"class_list":["post-16096","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cmake","tag-announcement","tag-c","tag-cmake","tag-cross-platform","tag-existing-code","tag-ide","tag-import","tag-openfolder"],"acf":[],"blog_post_summary":"<p>We&#8217;re excited to announce improved CMake and Ninja support in Visual Studio 15.3 Preview 2.\u00a0 In this preview, we have updated CMake from version 3.7.2 to version 3.8 and added improved support for the CMake Ninja generator.\u00a0 Additionally, this preview includes several fixes for community reported bugs. Please download the preview and try out the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/16096","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=16096"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/16096\/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=16096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=16096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=16096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}