msbuild - Adding additional library and include paths when compiling from command line -


i'm trying add additional paths used project group during compilation. since c++ builder 2010 uses msbuild have tried looking @ documentation , according can find additionallibpaths should passable property. i.e

msbuild /p:additionallibpaths=c:\foobar\libs /t:build foo.groupproj 

but doesn't seem use paths added. have noticed property names differ between vc++ , c++ builder when passed msbuild , wonder if c++ builder might use other property name add additional lib , include folders?

i don't want replace existing paths defined in project append additional ones. rationale when project build on our build server libraries reside in standardized place might differ it's installed on development machine.

msbuild acutally calls msbuild script file in turn calls additional scripts including .groupproj ones using tag. know new instance of msbuild created when using tag know have add property when running task in script.

<msbuild targets="build" projects="..\foo.groupproj" properties="config=debug (property add additional paths here!)" /> 

update:

c++ builder seems using includepath , ilink_librarypath setting these overwrite paths defined in project file. since file created , maintained ide changes make append instead of overwrite overwritten ide. kind of strange since looks should indeed append values

<includepath>..\foobar\;$(bds)\include;$(bds)\include\dinkumware;$(bds)\include\vcl;common components;..\config\config32;$(includepath)</includepath> 

update 2:

in codegear.cpp.targets added own property called additionalincludepaths propertygroup fiddling include paths.

around line 251

<propertygroup>         <bcc_nolink>true</bcc_nolink>         <ilink_osversion condition="'$(ilink_osversion)'=='' , '$(novcl)'!='true'">5.0</ilink_osversion>         <dcc_generatecppfiles>true</dcc_generatecppfiles>         <showstdout condition="'$(showstdout)'==''">$(showgeneralmessages)</showstdout>          <!-- _tchar mapping uni^h^h^h character selection -->         <startupobj condition="'$(_tcharmapping)'=='wchar_t'">$(startupobj)w</startupobj>         <ilink_startupobjs condition="'$(ilink_startupobjs)'==''">$(startupobj)</ilink_startupobjs>         <bcc_generateunicode condition="'$(_tcharmapping)'=='wchar_t'">true</bcc_generateunicode>         <!-- include paths -->         <win32librarypath condition="'$(win32librarypath)'==''">$(bds)\lib</win32librarypath>         <includepath condition="'$(cbuilderincludepath)'!=''">$(includepath);$(cbuilderincludepath)</includepath>                 <includepath condition="'$(additionalincludepath)'!=''">$(includepath);$(additionalincludepath)</includepath>         <bcc_includepath condition="'$(bcc_includepath)'!=''">$(bcc_includepath);$(includepath)</bcc_includepath>         <bcc_includepath condition="'$(bcc_includepath)'==''">$(includepath)</bcc_includepath>         <brcc_includepath condition="'$(brcc_includepath)'!=''">$(brcc_includepath);$(includepath)</brcc_includepath>         <brcc_includepath condition="'$(brcc_includepath)'==''">$(includepath)</brcc_includepath>         <dcc_includepath condition="'$(dcc_includepath)'!=''">$(dcc_includepath);$(includepath)</dcc_includepath>         <dcc_includepath condition="'$(dcc_includepath)'==''">$(includepath)</dcc_includepath>         <dcc_unitsearchpath>$(dcc_includepath);$(win32librarypath)</dcc_unitsearchpath>         <dcc_resourcepath>$(dcc_includepath)</dcc_resourcepath>         <dcc_objpath>$(dcc_includepath)</dcc_objpath>         <tasm_includepath condition="'$(tasm_includepath)'!=''">$(tasm_includepath);$(includepath)</tasm_includepath>         <tasm_includepath condition="'$(tasm_includepath)'==''">$(includepath)</tasm_includepath> 

then can call

msbuild /t:build /p:additionalincludepaths=c:\foo\include foo.groupproj 

this works fine , want. i'll have same library paths. don't want have hack 1 of embarcaderos supplied files this. that's ridiculous :p... isn't there official property set adding include paths , lib paths?

for vs2013, define environment variables before running msbuild:

set "include=%additional_include_path%;%include%" set "lib=%additional_lib_path%;%lib%" rem use environment variables include , lib values set useenv=true 

reference: msbuild/microsoft.cpp/v4.0/v120/microsoft.cpp.targets

<target name="setbuilddefaultenvironmentvariables"         condition="'$(useenv)' != 'true'"> ...     <setenv name   ="include"         value  ="$(includepath)"         prefix ="false" >        <output taskparameter="outputenvironmentvariable"             propertyname="include"/>     </setenv> 

but looks include , lib appended behind additional include/lib directories specified in project properties.


Comments