GDAL_COMPILATION and standalone plugins

Andrew C Aitchison via gdal-dev <[email protected]>
Newsgroups gmane.comp.gis.gdal.devel
Message-ID <[email protected]>
When should GDAL_COMPILATION be set ?

I would like a source tree for a driver.
Ideally it would be possible to build this in tree (both
as a plugin or compiled into libgdal.so) and standalone against
an existing gdal installation (with development libraries and headers).

I thought that GDAL_COMPILATION was a way to tell whether my driver
was being built as part of gdal, but I find that
cmake/helpers/SetupStandalonePlugin.cmake includes
cmake/helpers/GdalCompilationFlags.cmake which sets GDAL_COMPILATION

Why do I care ?
An in tree build will declare my GDALRegister function in
    gcore/gdal_frmts.h
(since it will be used in
    frmts/gdalallregister.cpp
) but an out of tree build will need to declare this itself.
I thought that testing GDAL_COMPILATION would be the way to avoid my
GDALRegister function being declared twice under some circumstances.

Any idea what I am missing or misunderstanding ?

Thanks,

-- 
Andrew C. Aitchison                      Kendal, UK
                    [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.