It's useful to have a separate directory to store object files in. However, gprbuild
will complain if the directory doesn't already exist. I use hg
for version control, which doesn't allow you to track empty directories (AFAIK this is true of git
as well), but even if it did, it's unfortunate to have to clutter up the repository with an empty directory. gprbuild
has an option, --create-missing-dirs
(short form -p
) which does precisely what it says on the tin. This is exceedingly useful. What I would like to know, however, is if there is some way to set this in a .gpr
file. It is obnoxious to have to remind my users to compile with the -p
option, instead of being able to just run gprbuild project
. Unfortunately, the docs for gprguild
have this to say:
By default, GPRbuild checks that the object, library and exec directories specified in project files exist. Switch
-p
instructs GPRbuild to attempt to create missing directories. Note that these switches may be specified in package Builder of the main project, but they are useless there as either the directories already exist or the processing of the project files has failed before the evaluation of the Builder switches, because there is at least one missing directory.
Surely there has to be a way to do what I am describing?