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.68.234.38 with SMTP id ub6mr3897734pbc.2.1339102078314; Thu, 07 Jun 2012 13:47:58 -0700 (PDT) Path: l9ni22700pbj.0!nntp.google.com!news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Copying ressource files with gprbuild References: Date: Thu, 07 Jun 2012 16:48:18 -0400 Message-ID: <821ulqvofh.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) Cancel-Lock: sha1:F2NLJ9TFgRX+jPJ/sjv0FE130EQ= MIME-Version: 1.0 X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 847ac4fd1136ee029e66106452 X-Received-Bytes: 2290 Content-Type: text/plain; charset=us-ascii Date: 2012-06-07T16:48:18-04: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. 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