From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ae783c6620b83ec7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.141.4 with SMTP id k4mr4240122bku.6.1339009697224; Wed, 06 Jun 2012 12:08:17 -0700 (PDT) Path: e27ni20967bkw.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Copying ressource files with gprbuild Date: Wed, 06 Jun 2012 20:08:16 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="VkRmmmXzMj956AdxXtqrqg"; logging-data="4067"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bOwsxLyTk7sxFpLpL8gGZnJPmLi5Yn5A=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) Cancel-Lock: sha1:sn52+BcLetGGdU6JHQ7KdGmSClM= sha1:hLL1pDhh80ofDOjiBz6J5pjGaxw= Content-Type: text/plain; charset=us-ascii Date: 2012-06-06T20:08:16+01:00 List-Id: Felix Krause 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. Presumably actually "bin/src"? > 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. If you are on a Unix-like system you might try a symbolic link; $ ln -s src bin/src But it might be better to use for example an environment variable to define the (absolute) location where the resource files are found.