Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile a Delphi projectgroup using MSBuild called from an Embarcadero Makefile

I am trying to compile the two components from Virtual Treeview (VirtualTreesR.bpl and VirtualTreesD.bpl) which I combined in a Delphi project group called VirtualTrees.groupproj. They should be compiled using MSBuild, but this call is done from a (Embarcadero) Makefile. The relevant part in the Makefile looks like:

msbuild.exe /nologo /v:m /t:build /p:Config=Release "$(VTVDIR)\Packages\Delphi 2010\VirtualTrees.groupproj"

Unfortunately this results in MSB4040, because the environment variable BDS is not set in cmd.exe, but it is in the Makefile. I tried a SET BDS=$(BDS) before the call to msbuild, but to no avail. I also tried to set BDS as property(/p:BDS=($BDS);Config=Release) which caused another error (something liks: Could not find compiler at %BDS%\bin\dcc32.exe).

This call from the Makefile is part of a preparation to build our product on a CI server, and I cannot guarantee that the BDS variable is set there. So how can I provide the BDS variable which I have in the Makefile to msbuild that it accepts it?

like image 679
andy Avatar asked Jan 21 '23 00:01

andy


1 Answers

In my batch files, I use rsvars.bat:

call "C:\Program Files (x86)\CodeGear\RAD Studio\5.0\bin\rsvars.bat"
MSBuild SomeProject.dproj ...

(You'd have to adjust the path obviously.)

like image 65
Uli Gerhardt Avatar answered Jan 22 '23 13:01

Uli Gerhardt