[CMake] working with, and installing, data files

Crni Gorac cgorac at gmail.com
Fri Nov 6 05:07:22 EST 2009


I'm using CMake as build system for a program that is in turn reading
some data files in run-time.  Obviously, program has to be able to
find data files both when installed, and when I'm developing it (and
I'd like to skip having to do "make install" each time when I change
data files while doing the development).  I looked into how some other
CMake based projects (CMake included) are handling this, but still I'd
appreciate any kind of advice on how to do it "properly".  At the
moment, I'm thinking about having an environment variable to point to
data directory, that I could define during the development to point to
the data directory in my source tree.  If that variable not defined,
then the program would check pre-defined data directory location, that
would be #define-d in compile time, so that correct path could be put
there with regards to the installation prefix; any suggestions for
better arrangement here? If I understood it properly, CMake is doing
something similar itself...

Thanks.


More information about the CMake mailing list