User forums > Using Code::Blocks

prebuild script question?

(1/1)

jfpjr:
I am trying to add a file to the project with a prebuild script. The file should be compiled and added to both debug and release targets.

The command I have tried is

project.AddFile(5,project_file.file.GetName() + _T(".aaa"),GetProjectManager().GetActiveProject(),true,true,50);

It adds the file but does not set the compile bit or add to target.
I have set a custom build command in the advanced options for the compiler and it
works when I manually add the checkmarks to file prop.

Win XP Mingw Aug 22 nightly

stahta01:
The extension appears, at first glance at code, to need to be an valid ftSource or ftResource extension.

I think filefilters.cpp is where extensions are added.

globals.cpp seems to be where extensions are added to ftSource.

Tim S

Navigation

[0] Message Index

Go to full version