[CMake] Accessing data

Robert Dailey rcdailey.lists at gmail.com
Mon Mar 18 14:05:45 EDT 2013


Hey Matthew.

I'm actually doing the latter. I setup my working directory in Visual
Studio project settings. I also setup add_test() to default to that
data directory when running them from ctest. Note that the tests also
need access to data, which is why they also have this logic.

On Thu, Mar 14, 2013 at 11:39 AM, Matthew Woehlke
<mwoehlke.floss at gmail.com> wrote:
>
>
> On 2013-03-11 14:03, Robert Dailey wrote:
>>
>> I have setup all of my compiled binaries to be placed in
>> <build_dir>/output. Certain executables need to access data files
>> relative to the executable's current position.
>
>
> Do you really mean that you have logic to determine the disk location of the
> executable? Or do you mean you expect to find data in the current working
> directory?
>
> If the latter, just change your debugger settings to set a "reasonable"
> (i.e. "where your data files live") working directory.
>
> I'd be a little suspicious if you are really doing the former... using some
> sort of configuration mechanism would probably be better.
>
> --
> Matthew
>


More information about the CMake mailing list