The following main wants to be compiled via msbuild
#include <stdio.h>
int main (int argc, char *argv[])
{
char Buffer[2000];
printf("TEST");
gets(Buffer);
}
A Batch file calls msbuild:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild main.vcxproj
pause
The msbuild project file is as follows.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ItemGroup>
<ClCompile Include="main.c" />
</ItemGroup>
</Project>
The whole setup works so far but i need to find a good source to help me learn more about msproject files. I want to learn multiple things. How can I:
- get rid of the "Import" oprtions and define the imported parts myself
- use a commandline parameter to compile a set of files... ( %param%.c %param%TEST.c ,...)
- use the projectfile to launch programs immediatelly ( %param%Test.exe )
- compile multiple targets,... release, debug, etc
- copy after compiling : Subproject/release/%param%.obj -> c:\accurateVersion\%param%.obj
- Clean before rebuilding