Opened 10 years ago

Closed 9 years ago

#1782 closed defect (fixed)

Use gdal-config instead guessing the header/library locations

Reported by: bernd@… Owned by: cbro@…
Priority: major Milestone:
Component: merkaartor Version:
Keywords: Cc:

Description

Hi developers,

depending on the distribution, the gdal libraries and headers are not necessarily in /usr/{include,lib}. You should use gdal-config to find the necessary linker and preprocessor flags.

http://git.debian.org/?p=collab-maint/merkaartor.git;a=blob;f=debian/patches/gdal-config

is what I'm using in Debian, not sure if there's a better way, though.

Cheers,

Bernd

Change History (3)

comment:1 Changed 10 years ago by achims311

Patch against 0.14-svn: Index: src/src.pro =================================================================== --- src/src.pro (Revision 14923) +++ src/src.pro (Arbeitskopie) @@ -185,8 +185,8 @@

win32-g++:LIBS += -lgdal

} unix {

  • INCLUDEPATH += /usr/include/gdal
  • LIBS += -lgdal

+ INCLUDEPATH += $$system(gdal-config --cflags) + LIBS += $$system(gdal-config --libs)

}

} world_shp.path = $${SHARE_DIR}

comment:2 Changed 10 years ago by bernd@…

+               INCLUDEPATH += $$system(gdal-config --cflags)

This doesn't sound like a good idea:

  • INCLUDEPATH is a list of paths, not of preprocessor options.
  • gdal-config --cflags may return more than -I flags (although it doesn't do it

yet).

comment:3 Changed 9 years ago by Chris Browet

Resolution: fixed
Status: newclosed

(In [20144]) FIX : Use gdal-config instead guessing the library locations (fixes #1782)

Note: See TracTickets for help on using tickets.