Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically copy resources to the DCU output folder

I would like to know, is there a way to automatically make the IDE/Compiler/other copy all the resource that needs to be linked with the DCU to the DCU output folder.

I often use forms that I pre-compile to avoid the needs to recompile the unit all the time in my main projects. The DCU gets updated, but we need to copy the DFM manually everytime it changes. Same goes for any {$R *.res} specified. Maybe we could maintain those file directly in the DCU folder... but doesn't quite make sense to have a .DFM in a different folder than a .PAS

I looked for a compiler switch that would do it... Unsuccesfully.

Anyone knows if/how it can be achieved?

I'm using Delphi 2010

like image 735
Ken Bourassa Avatar asked Feb 16 '10 21:02

Ken Bourassa


People also ask

What is Copy to Output Directory?

"Copy to Output Directory" is the property of the files within a Visual Studio project, which defines if the file will be copied to the project's built path as it is. Coping the file as it is allows us to use relative path to files within the project.


1 Answers

You could create a simple Post Build event which performed the copying. That way whenever you did a build, the system would copy the necessary files for you. The build events are available from the Project Options menu, there is a Pre-build and a Post-Build script.

like image 138
skamradt Avatar answered Nov 05 '22 14:11

skamradt