title: Adding additional library and include paths when compiling from command line
body: <p>I'm trying to add additional paths to be used by my project group during compilation. Since <em>C++ Builder 2010</em> uses <em>msbuild</em> I have tried looking at the documentation for that and according to what I can find <em>AdditionalLibPaths</em> should be passable as a property. i.e</p>
  
  <pre><code>msbuild /p:AdditionalLibPaths=C:\FooBar\Libs /t:build foo.groupproj
  </code></pre>
  
  <p>But it doesn't seem to use the paths I added. I have previously noticed that some property names differ between <strong>VC++</strong> and <strong>C++ Builder</strong> when passed to <em>msbuild</em> and wonder if <em>C++ Builder</em> might use some other property name to add additional lib and include folders?</p>
  
  <p>I don't want to <em>replace</em> the existing paths defined in the project but append additional ones. The rationale for this is that when the project is build on our build server some libraries reside in a standardized place that might differ from where it's installed on the development machine.</p>
  
  <p><em>msbuild</em> acutally calls a <em>msbuild script file</em> that in turn calls additional scripts including the <em>.groupproj</em> ones using the <em></em> tag. I know that a new instance of <em>msbuild</em> is created when using the <em></em> tag so I know that I have to add the property when running that task in my script.</p>
  
  <pre><code>&lt;MSBuild Targets="Build" Projects="..\Foo.groupproj" Properties="Config=Debug (property to add additional paths here!)" /&gt;
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <p><em>C++ Builder</em> seems to be using <em>IncludePath</em> and <em>ILINK_LibraryPath</em> but setting these overwrite the paths already defined in the project file. Since this file is created and maintained by the IDE so any changes to make it append instead of overwrite would be overwritten by the IDE. Which is kind of strange since it looks like it should indeed append the values</p>
  
  <pre><code>&lt;IncludePath&gt;..\FooBar\;$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;Common Components;..\Config\Config32;$(IncludePath)&lt;/IncludePath&gt;
  </code></pre>
  
  <p><strong>Update 2:</strong></p>
  
  <p>In <em>CodeGear.Cpp.Targets</em> I added my own <em>property</em> called <em>AdditionalIncludePaths</em> to the <em>PropertyGroup</em> fiddling with the include paths.</p>
  
  <p><em>Around line 251</em></p>
  
  <pre><code>&lt;PropertyGroup&gt;
          &lt;BCC_NoLink&gt;true&lt;/BCC_NoLink&gt;
          &lt;ILINK_OSVersion Condition="'$(ILINK_OSVersion)'=='' And '$(NoVCL)'!='true'"&gt;5.0&lt;/ILINK_OSVersion&gt;
          &lt;DCC_GenerateCppFiles&gt;true&lt;/DCC_GenerateCppFiles&gt;
          &lt;ShowStdOut Condition="'$(ShowStdOut)'==''"&gt;$(ShowGeneralMessages)&lt;/ShowStdOut&gt;
  
          &lt;!-- _TCHAR mapping for Uni^H^H^H character selection --&gt;
          &lt;StartupObj Condition="'$(_TCHARMapping)'=='wchar_t'"&gt;$(StartupObj)w&lt;/StartupObj&gt;
          &lt;ILINK_StartupObjs Condition="'$(ILINK_StartupObjs)'==''"&gt;$(StartupObj)&lt;/ILINK_StartupObjs&gt;
          &lt;BCC_GenerateUnicode Condition="'$(_TCHARMapping)'=='wchar_t'"&gt;true&lt;/BCC_GenerateUnicode&gt;
          &lt;!-- Include Paths --&gt;
          &lt;Win32LibraryPath Condition="'$(Win32LibraryPath)'==''"&gt;$(BDS)\lib&lt;/Win32LibraryPath&gt;
          &lt;IncludePath Condition="'$(CBuilderIncludePath)'!=''"&gt;$(IncludePath);$(CBuilderIncludePath)&lt;/IncludePath&gt;
                  &lt;IncludePath Condition="'$(AdditionalIncludePath)'!=''"&gt;$(IncludePath);$(AdditionalIncludePath)&lt;/IncludePath&gt;
          &lt;BCC_IncludePath Condition="'$(BCC_IncludePath)'!=''"&gt;$(BCC_IncludePath);$(IncludePath)&lt;/BCC_IncludePath&gt;
          &lt;BCC_IncludePath Condition="'$(BCC_IncludePath)'==''"&gt;$(IncludePath)&lt;/BCC_IncludePath&gt;
          &lt;BRCC_IncludePath Condition="'$(BRCC_IncludePath)'!=''"&gt;$(BRCC_IncludePath);$(IncludePath)&lt;/BRCC_IncludePath&gt;
          &lt;BRCC_IncludePath Condition="'$(BRCC_IncludePath)'==''"&gt;$(IncludePath)&lt;/BRCC_IncludePath&gt;
          &lt;DCC_IncludePath Condition="'$(DCC_IncludePath)'!=''"&gt;$(DCC_IncludePath);$(IncludePath)&lt;/DCC_IncludePath&gt;
          &lt;DCC_IncludePath Condition="'$(DCC_IncludePath)'==''"&gt;$(IncludePath)&lt;/DCC_IncludePath&gt;
          &lt;DCC_UnitSearchPath&gt;$(DCC_IncludePath);$(Win32LibraryPath)&lt;/DCC_UnitSearchPath&gt;
          &lt;DCC_ResourcePath&gt;$(DCC_IncludePath)&lt;/DCC_ResourcePath&gt;
          &lt;DCC_ObjPath&gt;$(DCC_IncludePath)&lt;/DCC_ObjPath&gt;
          &lt;TASM_IncludePath Condition="'$(TASM_IncludePath)'!=''"&gt;$(TASM_IncludePath);$(IncludePath)&lt;/TASM_IncludePath&gt;
          &lt;TASM_IncludePath Condition="'$(TASM_IncludePath)'==''"&gt;$(IncludePath)&lt;/TASM_IncludePath&gt;
  </code></pre>
  
  <p>Then I can call </p>
  
  <pre><code>msbuild /t:build /p:AdditionalIncludePaths=C:\Foo\Include foo.groupproj
  </code></pre>
  
  <p>This works fine and does what I want. I'll just have to do the same with the library paths. But I don't want to have to hack one of Embarcaderos supplied files like this. That's just ridiculous :P... Isn't there any official property to set for adding include paths and lib paths?</p>