[CMake] Accessing data

Robert Dailey rcdailey.lists at gmail.com
Mon Mar 11 14:03:35 EDT 2013


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. When I'm debugging
through visual studio, it cannot access the data unless I setup a
post-build event to copy the data to the 'output' directory. I don't
want to do this, since the data could be very large (gigabytes).

Any suggestion on how to setup CMake scripts to allow targets to
reference data in a relative way? This is a tough problem to solve
simply because when the program is installed, the data will actually
be placed next to the executable in that case so no special logic is
required to get it to find it.


More information about the CMake mailing list