Qt4Ada - An Ada2005 binding to Qt4

 

The purpose of is to have the same role as the qmake tool provided with Qt, but tailored for with special features needed by the Ada programming language.

The idea is to have a single project file to describe a project, regardless of the compiler or the platform used. Then will take care to generate needed additionnal files, providing needed flags to the various tools implied, so that the whole project can be built. All of this being done according to a single platform- and compiler-specific configuration file.

As of this writing, both file are rather simple text files containing variable = value pairs. The value can be a space-separated list of strings, which can span multiple lines when using the usual \ character.

You can use environment variables by writing ${VAR_NAME}. Some variables can be computed on-the-fly if they're not found:

The configuration files

The various configuration files for the various possible combinations of compilers and platforms can be found in subfolders in the folder mkspecs where has been installed, in the same way it is done by Qt itself. They're all named q4amake.conf.

Use the environment variable Q4AMAKESPEC to tell which configuration file to use.

For example, if you're using on a GNU/Linux platform, the Ada compiler being GNAT, then define (assuming you're using the Bash shell):

export QT4ADA=/where/is/qt4ada
export Q4AMAKESPEC=linux-gnat

will use the configuration file $QT4ADA/mkspecs/$Q4AMAKESPEC/q4amake.conf, in our example /where/is/qt4ada/mkspecs/linux-gnat/q4amake.conf

The project file

Known variables:

BODIES

List here the files containing packages bodies (*.adb files). Example:

BODIES = package_1.adb package2.adb \
         package_3.adb

CONFIG

More or less the same as qmake's CONFIG variable. As of this writing, only meaningfull values are:

HEADERS

The same as qmake's HEADERS variable: list here C++ header files (*.h files).

INTERFACES

When creating a library (TEMPLATE = lib), this should list the packages' names that will be made available to the users. Example:

INTERFACES = package_1 package2 \
             package_3

Note that you shall give only packages names, not filenames.

LIB_ALI_DIR

When creating a library, single value telling where to put the Ada link information files (*.ali files).

LIB_DIR

Single value telling where to put the shared library binary file when creating a library.

LIB_INTERFACES_DIR

When creating a library, single value telling where to place the needed packages files according to the INTERFACES list.

MAINS

When creating an application (TEMPLATE = app), give here the files containing the main procedures.

MOC_DIR

Single value telling where to store temporary files generated by Qt's moc, in case you're mixing C++ and Ada (as does itself).

OBJECTS_DIR

Single value telling where to store intermediate objects files.

QT

List here the needed Qt modules. In the future these might be guessed from the source code, but for now you have to list them all explicitly (including the core module). Example for an application or library using Qt's gui and OpenGL modules:

QT = core gui opengl

As of this writing, the meaningfull values are core, gui, dbus, network, opengl, sql, svg and xml.

SOURCES

The same as qmake's SOURCES variable: list here C++ source files (*.cpp files).

SOURCES_DIRS

List here the various directories containing your source files.

SPECS

List here the files containing packages specifications (*.ads files). Example:

BODIES = package_1.ads package2.ads \
         package_3.ads

SUBDIRS

When configuring a tree of sub-projects (TEMPLATE = subdirs), list here the subdirectories to recurse into. Each subdirectory should contain a project file having the same name.

TARGETS or TARGET

Give in this variable the name of the resulting executables or library name.

TEMPLATE

The same as Qt's TEMPLATE variable. Meaningfull values: