Blog

Intel Fortran in Team Build

For any Visual Studio project, like an Intel .vfproj, that is not supported by MSBuild, it can be wrapped in a simple .proj file. The .proj file, just like a .sln, can be built by MSBuild on a machine with Visual Studio (and other needed dependencies). Here is a .proj file to get you started. You will need to replace the solution and project names. You should also double-check the visual studio version.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <SolutionFile>$(MSBuildProjectDirectory)Solution.sln</SolutionFile>
    <ProjectFile>$(MSBuildProjectDirectory)MyProjectMyProject.vfproj</ProjectFile>
    <Configuration>Debug|x64</Configuration>
    <DevEnv>C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEdevenv.com
</DevEnv>
  </PropertyGroup>
  <Target Name="Build">
    <Exec
    Command="&quot;$(DevEnv)&quot; &quot;$(SolutionFile)&quot; /Rebuild &quot;
$(Configuration)&quot; /Project &quot;$(ProjectFile)&quot; /ProjectConfig 
&quot;$(Configuration)&quot; /Log"
    ContinueOnError="false"
    IgnoreExitCode="false"
    WorkingDirectory="$(MSBuildProjectDirectory)" />
  </Target>
  <Target Name="Clean">
    <Exec
    Command="&quot;$(DevEnv)&quot; &quot;$(SolutionFile)&quot; /Clean 
&quot;$(Configuration)&quot; /Project &quot;$(ProjectFile)&quot; 
/ProjectConfig &quot;$(Configuration)&quot; /Log"
    ContinueOnError="false"
    IgnoreExitCode="false"
    WorkingDirectory="$(MSBuildProjectDirectory)" />
  </Target>
</Project>
Note that we also include a Clean target. That is needed if your Team Build is configured to not require a clean workspace. This really speeds up builds that have a lot of source files (e.g. something including Boost). Save the .proj alongside your existing solution and check it in. Then edit the build process to add a project. Add the .proj before the .sln. You will probably need to disable the building of the .vfproj in the solution configuration built by your team build. In that case you can add another solution configuration, different from the one developers use in Visual Studio. Contact us if you run into trouble. If, at the end of the day, you aren’t satisfied with this solution, then great news: MSBuild is now open-source! So let us know if you submit a pull request to support .vfproj, or some other project types!

Hank Beasley

View all posts by

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *