comp.lang.ada
 help / color / mirror / Atom feed
From: Felix Krause <flyx@isobeef.org>
Subject: Copying ressource files with gprbuild
Date: Wed, 6 Jun 2012 20:43:01 +0200
Date: 2012-06-06T20:43:01+02:00	[thread overview]
Message-ID: <jqo8bl$gn4$1@online.de> (raw)

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.

After reading through the GPRBuild manual, it seems that there is no 
standard way of doing this with a project file. I thought about 
defining a custom language "txt" in the project file, and setting up 
appropriate drivers in the Compiler, Binder and Linker packages so that 
it will just be piped through the build process and lands in the 
executable output directory. But I couldn't figure out how I can get 
gprbuild to do this, and it also smells like a rather ugly hack.

Now I know I can probably write some Makefile that will take care of 
copying the ressource files. But I'd like to know how others handle 
this problem, and if there is a way to handle ressource files with the 
project file.

-- 
Felix




             reply	other threads:[~2012-06-06 18:43 UTC|newest]

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

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