{"id":2297,"date":"2017-01-18T19:30:25","date_gmt":"2017-01-19T03:30:25","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=2297"},"modified":"2017-01-18T19:30:25","modified_gmt":"2017-01-19T03:30:25","slug":"converting-visualgdb-make-projects-to-msbuild","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/msbuild\/convert\/","title":{"rendered":"Converting VisualGDB Make projects to MSBuild"},"content":{"rendered":"<p>This tutorial shows how to convert Makefile-based projects created with previous versions of VisualGDB to the new MSBuild backend. We will create a GNU Make-based project and convert it to the new MSBuild backend that supports faster building, precompiled headers, per-file settings and other advanced features. The steps shown in this tutorial will also work for CMake projects.<\/p>\n<p>Before you begin, install VisualGDB 5.2R2 or later.<\/p>\n<ol>\n<li>Start Visual Studio and open the VisualGDB Embedded Project Wizard. The same steps will also work for the Linux Project Wizard:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/01-prjname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2298\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/01-prjname.png\" alt=\"01-prjname\" width=\"786\" height=\"511\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/01-prjname.png 786w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/01-prjname-300x195.png 300w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/a><\/li>\n<li>On the first page select &#8220;Create a new project&#8221; and switch the build system to &#8220;GNU Make&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/02-make.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2299\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/02-make.png\" alt=\"02-make\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/02-make.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/02-make-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a>Selecting &#8220;GNU Make&#8221; will create an old-style Makefile-based project so that we can then convert it to the new MSBuild system.<\/li>\n<li>Select your embedded device. The steps shown in this tutorial will work for any supported device, so select the one you typically use:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/03-device.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2300\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/03-device.png\" alt=\"03-device\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/03-device.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/03-device-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Proceed with the default project sample:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/04-sample.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2301\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/04-sample.png\" alt=\"04-sample\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/04-sample.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/04-sample-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>If you want to test your project under debugger, select your debugging settings on the last page. Otherwise simply click &#8220;Finish&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/05-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2302\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/05-debug.png\" alt=\"05-debug\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/05-debug.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/05-debug-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>VisualGDB will now create a project for you. Before we begin converting it to MSBuild, open the VisualGDB Project Properties and add some extra include directories, preprocessor macros and library directories to see how those settings will be converted:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/06-settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2307\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/06-settings.png\" alt=\"06-settings\" width=\"1159\" height=\"736\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/06-settings.png 1159w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/06-settings-300x191.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/06-settings-1024x650.png 1024w\" sizes=\"(max-width: 1159px) 100vw, 1159px\" \/><\/a><\/li>\n<li>Build the project and ensure it succeeds:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/07-makefile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2306\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/07-makefile.png\" alt=\"07-makefile\" width=\"977\" height=\"667\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/07-makefile.png 977w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/07-makefile-300x205.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/07-makefile-130x90.png 130w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a>Note how the extra settings we entered in the previous step got saved to the <strong>debug.mak<\/strong> file.<\/li>\n<li>Now we will proceed with the conversion. Right-click on the project in Solution Explorer and select &#8220;Convert project to MSBuild&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/08-convert.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2305\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/08-convert.png\" alt=\"08-convert\" width=\"977\" height=\"667\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/08-convert.png 977w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/08-convert-300x205.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/08-convert-130x90.png 130w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/li>\n<li>If you are doing this with a real-world project, make a good backup. The conversion is irreversible and may cause strange errors if your Makefile has modifications that VisualGDB cannot recognize. Once you are done, proceed with the conversion:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-confirm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2304\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-confirm.png\" alt=\"09-confirm\" width=\"977\" height=\"667\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-confirm.png 977w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-confirm-300x205.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-confirm-130x90.png 130w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/li>\n<li>VisualGDB will report that the conversion is complete. Note how the current platform got switched to &#8220;VisualGDB&#8221;. Build the project to ensure that conversion was successful:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-platform.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2303\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-platform.png\" alt=\"10-platform\" width=\"977\" height=\"667\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-platform.png 977w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-platform-300x205.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-platform-130x90.png 130w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/li>\n<li>\u00a0\u00a0\u00a0 Open VisualGDB Project Properties. Note how instead of Makefile Settings page VisualGDB now shows MSBuild Settings and the manually added settings were automatically converted:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/11-settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2308\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/11-settings.png\" alt=\"11-settings\" width=\"786\" height=\"593\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/11-settings.png 786w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/11-settings-300x226.png 300w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/a><\/li>\n<li>If you open the Visual Studio project properties, you will see settings similar to the normal Visual Studio projects for Windows. The settings imported from the Makefile project will be present there:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/12-settings2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2309\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/12-settings2.png\" alt=\"12-settings2\" width=\"822\" height=\"558\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/12-settings2.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/12-settings2-300x204.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Review the Visual Studio project properties to ensure that all the relevant settings got automatically converted. If some of them do not match the Makefile project, adjust them manually:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/16-review.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2313\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/16-review.png\" alt=\"16-review\" width=\"822\" height=\"558\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/16-review.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/16-review-300x204.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>If you now try to switch the configuration back to x86 (or Win32), the build will fail, as the .vgdbsettings files got converted to the new MSBuild system and don&#8217;t support launching GNU Make anymore:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/13-buildfail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2310\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/13-buildfail.png\" alt=\"13-buildfail\" width=\"977\" height=\"667\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/13-buildfail.png 977w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/13-buildfail-300x205.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/13-buildfail-130x90.png 130w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/li>\n<li>To avoid confusion we recommend removing the non-VisualGDB platforms from your solution and projects on you can confirm that the MSBuild platform works:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/15-removemak.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2311\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/14-remove.png\" alt=\"14-remove\" width=\"977\" height=\"667\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/14-remove.png 977w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/14-remove-300x205.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/14-remove-130x90.png 130w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/li>\n<li>You can now also remove the Makefile and .mak files from Solution Explorer and physically delete them. The MSBuild system does not use them:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/15-removemak.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2312\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/15-removemak.png\" alt=\"15-removemak\" width=\"977\" height=\"667\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/15-removemak.png 977w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/15-removemak-300x205.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/15-removemak-130x90.png 130w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to convert Makefile-based projects created with previous versions of VisualGDB to the new MSBuild backend. We<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[131],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2297"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=2297"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2297\/revisions"}],"predecessor-version":[{"id":2314,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2297\/revisions\/2314"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=2297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=2297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=2297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}