Home

Using GPRbuild for build the application

You can uses GNAT Project Files with conjunction with the GPRbuild tool for build application. You need to separate project in to the two project files: one for the build application itself and another for run Ada Meta Object Compiler for generate meta information packages.

The primary project file follows ordinary application project file rules, the only important things what it must "with" the project file for the meta information packages generation and list the directory with the generated meta information packages in the list of source directories. For example:

with "qt_gui";
with "main_moc";

project Main is
   for Main use ("main.adb");
   for Source_Dirs use (".", ".amoc");
   for Object_Dir use ".objs";
end Main;

The project file for the meta information packages generation is also very simple. It declares the language "Amoc", provides list of the source files for meta information generation and specify output directory. For example:

with "qt_gui";

project Main_Moc is
    for Languages use ("Amoc");
    for Source_Files use ("my_widgets-impl.ads");
    for Object_Dir use ".amoc";
end Main_Moc;

For build application using this project files you need to run gprbuild:

gprbuild -p -Pmain


QtAda 2.1