[GRASS-dev] GUI code dest dir

Glynn Clements glynn at gclements.plus.com
Fri Apr 18 16:40:19 PDT 2014


Vaclav Petras wrote:

> Note that for C/C++ code we have a similar issue. In the source code,
> includes are in `include` but in distribution they are in `include/grass`
> so you have to do
> 
> #include grass/raster.h
> 
> but if you are editing source code in some clever editor and you want to
> jump from the .c file to the header, you cannot since there is no `grass`
> directory in src. This applies also for code completion etc. Of course, you
> can set the editor so that it finds the files in dist but you don't want to
> jump to dist, but to source code.

All other factors being equal, moving include/* to include/grass/*
would be a good thing. We've made similar moves in the past, e.g.
gisdefs.h -> defs/gis.h, lib/python/*.py -> lib/python/script/*.py.
Did these cause any particular problems?

You may be able to trick an IDE by adding a symlink, e.g.

	ln -s . include/grass

so that include/grass is a symlink to include.

One thing to bear in mind: if the source and staging (dist.$arch)
versions of a file differ, it's the staging version which is actually
used for compilation and linking.

Essentially, a module or library which depends upon some other library
uses the installed version of the dependency, for some value of
"installed" (either the staging version or, if you override GISBASE,
the really-installed version)

This allows you to build most of GRASS, install it, "make clean", then
subsequently build extra modules against the installed version, rather
than having to build everything from scratch.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list