[build2] Installation Configuration Variables: Absolute Paths, Config Location, Version Tag

Markus Pawellek markus.pawellek at mailbox.org
Fri Apr 16 17:58:22 UTC 2021


Hello,

for an application which needs to use other resources besides code,
like a game which needs to display a background image,
one also needs to install those resources to the directory given by 'config.install.data'.
But the installed application also must know about the absolute path
to the resource file to be able to load and use it.
For me, using the 'in' module to generate code by the build system,
which declares this path as a C++ variable, seemed to be appropriate.
Sadly, I was not able to get this path neither from 'config.install.data' nor from 'install.data',
because, according to the documentation,
the 'install' variables are typically defined with starting nodes
that are to be resolved by the 'install' module.
Can I use this functionality to get the absolute paths for myself as well?
Or should I choose a completely different approach?

Furthermore, I would like to request a new feature.
In my opinion, another 'config.install' variable
for specifying the location of the program's system configuration files,
like in the following, could be useful.

config.install.etc    = data_root/etc
config.install.config = etc/<project>

The build system would then be able to create the given directory
and copy default system configuration files that are given by the project
when installing it.
Also this absolute path could be inserted into a generated C++ file.

Additionally, if different versions of a project are allowed
and need different configurations and/or resource files,
the tag '<version>' would come in handy
when defining the directories of the installation,
like in the following.

config.install.data   = share/<private>/<project>/<version>
config.install.config = etc/<private>/<project>/<version>

But here, one would have to adjust other installation variables as well, I think.
So I am not sure, if this would be possible.

What are you thinking about these ideas?
Thanks in advance.

Greetings
Markus



More information about the users mailing list