comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Copying ressource files with gprbuild
Date: Thu, 07 Jun 2012 16:48:18 -0400
Date: 2012-06-07T16:48:18-04:00	[thread overview]
Message-ID: <821ulqvofh.fsf@stephe-leake.org> (raw)
In-Reply-To: jqo8bl$gn4$1@online.de

Felix Krause <flyx@isobeef.org> writes:

> I develop an application which depends on some ressource files. Let's
> say these ressource files are located in my source folder "src", next
> to the Ada sources, and let "ressource.txt" be one of these ressource
> files. I compile my application with GPRBuild and a standard folder
> setup. Currently, my code loads the ressource with the path
> "../src/ressource.txt", which works when I compile the code, navigate
> to the "bin" directory, and execute the binary there. It also works
> from inside GPS.
>
> Now I want to do some debugging. Therefore, I switch to build mode
> "debug" in GPS, which causes the executable to be executed in
> "bin/debug". From there, it obviously cannot locate ressource.txt. So
> I need some possibility to copy the ressource file to the folder the
> executable gets written to.

For development, I use separate build directories for 'release' and
'debug':

project

project/build/debug

project/build/release

project/source

That way, relative paths from either build directory to source are
correct.

However, once you get to distribution, that relative path will be wrong.

One solution is to follow an operating system standard like Debian,
which specifies where resource files go. Or define your own standard.

In any case, allowing the user to override the location via an
environment variable makes sense, and you can then use that during
development.


None of this has to do with gprbuid; I would definitely use a Makefile
to copy the files to the right place.

-- 
-- Stephe



      parent reply	other threads:[~2012-06-07 20:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 18:43 Copying ressource files with gprbuild Felix Krause
2012-06-06 19:08 ` Simon Wright
2012-06-06 20:06 ` gautier_niouzes
2012-06-07 20:48 ` Stephen Leake [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox