forked from GPSBabel/gpsbabel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support third party library configuration in qmake (GPSBabel#611)
* add qmake options to specify libraries. * fix no libusb along lines of GPSBabel#610 * correct inclusion of shapelib headers. * more closely match original includes instead of trying to use HAVE_*, ENABLED_* *_INHIBITED and -I options in a consistent manner. We can revisit this after the demise of configure. * add qmake message when libusb is disabled.
- Loading branch information
Showing
8 changed files
with
166 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
#endif | ||
|
||
#include "../defs.h" | ||
#include "src/core/logging.h" | ||
|
||
#if !HAVE_LIBUSB_1_0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
macx|linux|openbsd { | ||
!defined(WITH_LIBUSB, var) { | ||
macx: WITH_LIBUSB = included | ||
linux|openbsd: WITH_LIBUSB = system | ||
} | ||
equals(WITH_LIBUSB, no) { | ||
message("libusb-1.0 disabled") | ||
JEEPS += jeeps/gpsusbstub.cc | ||
} else { | ||
DEFINES += HAVE_LIBUSB_1_0 | ||
JEEPS += jeeps/gpslibusb.cc | ||
equals(WITH_LIBUSB, pkgconfig) { | ||
message("Using libusb-1.0 found by pkg-config") | ||
PKGCONFIG += libusb-1.0 | ||
DEFINES += LIBUSB_H_INCLUDE=$$shell_quote(<libusb.h>) | ||
} else { | ||
linux|openbsd { | ||
equals(WITH_LIBUSB, system) { | ||
LIBS += "-lusb-1.0" | ||
DEFINES += LIBUSB_H_INCLUDE=$$shell_quote(<libusb-1.0/libusb.h>) | ||
} else:equals(WITH_LIBUSB, custom) { | ||
message("libusb-1.0 is enabled but but must be manually configured") | ||
message(" e.g. qmake WITH_LIBUSB=custom LIBS+=... INCLUDEPATH+=...") | ||
DEFINES += LIBUSB_H_INCLUDE=$$shell_quote(<libusb.h>) | ||
} else { | ||
error("WITH_LIBUSB=no|pkgconfig|system*|custom"); | ||
} | ||
} | ||
|
||
macx { | ||
equals(WITH_LIBUSB, included) { | ||
# TODO: It would be better to create an archive and link to it | ||
# to separate library build requirements from gpsbabel requirements. | ||
DEFINES += LIBUSB_H_INCLUDE=$$shell_quote(\"mac/libusb/libusb.h\") | ||
LIBS += -lobjc -framework IOKit -framework CoreFoundation | ||
INCLUDEPATH += mac/libusb \ | ||
mac/libusb/Xcode | ||
SOURCES += mac/libusb/core.c \ | ||
mac/libusb/descriptor.c \ | ||
mac/libusb/hotplug.c \ | ||
mac/libusb/io.c \ | ||
mac/libusb/strerror.c \ | ||
mac/libusb/sync.c \ | ||
mac/libusb/os/darwin_usb.c \ | ||
mac/libusb/os/poll_posix.c \ | ||
mac/libusb/os/threads_posix.c | ||
HEADERS += mac/libusb/hotplug.h \ | ||
mac/libusb/libusb.h \ | ||
mac/libusb/libusbi.h \ | ||
mac/libusb/version.h \ | ||
mac/libusb/version_nano.h \ | ||
mac/libusb/os/darwin_usb.h \ | ||
mac/libusb/os/poll_posix.h \ | ||
mac/libusb/os/threads_posix.h | ||
} else:equals(WITH_LIBUSB, custom) { | ||
message("libusb-1.0 is enabled but but must be manually configured") | ||
message(" e.g. qmake WITH_LIBUSB=custom LIBS+=... INCLUDEPATH+=...") | ||
DEFINES += LIBUSB_H_INCLUDE=$$shell_quote(<libusb.h>) | ||
} else { | ||
error("WITH_LIBUSB=no|pkgconfig|included*|custom"); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
!defined(WITH_SHAPELIB, var):WITH_SHAPELIB = included | ||
equals(WITH_SHAPELIB, no) { | ||
message("shapelib disabled") | ||
} else { | ||
DEFINES += SHAPELIB_ENABLED | ||
equals(WITH_SHAPELIB, pkgconfig) { | ||
message("Using shapelib found by pkg-config") | ||
PKGCONFIG += shapelib | ||
DEFINES += HAVE_LIBSHAPE | ||
} else:equals(WITH_SHAPELIB, included) { | ||
# TODO: It would be better to create an archive and link to it | ||
# to separate library build requirements from gpsbabel requirements. | ||
SOURCES += shapelib/shpopen.c shapelib/dbfopen.c shapelib/safileio.c | ||
HEADERS += shapelib/shapefil.h | ||
} else:equals(WITH_SHAPELIB, custom) { | ||
message("shapelib is enabled but but must be manually configured") | ||
message(" e.g. qmake WITH_SHAPELIB=custom LIBS+=... INCLUDEPATH+=...") | ||
DEFINES += HAVE_LIBSHAPE | ||
} else { | ||
error("WITH_SHAPELIB=no|pkgconfig|included*|custom"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
!defined(WITH_ZLIB, var):WITH_ZLIB = included | ||
equals(WITH_ZLIB, no) { | ||
message("zlib disabled") | ||
DEFINES += ZLIB_INHIBITED | ||
} else { | ||
equals(WITH_ZLIB, pkgconfig) { | ||
message("Using zlib found by pkg-config") | ||
PKGCONFIG += $$shell_quote(zlib > 1.2.8) | ||
DEFINES += HAVE_LIBZ | ||
} else:equals(WITH_ZLIB, included) { | ||
# TODO: It would be better to create an archive and link to it | ||
# to separate library build requirements from gpsbabel requirements. | ||
SOURCES += zlib/adler32.c \ | ||
zlib/compress.c \ | ||
zlib/crc32.c \ | ||
zlib/deflate.c \ | ||
zlib/inffast.c \ | ||
zlib/inflate.c \ | ||
zlib/infback.c \ | ||
zlib/inftrees.c \ | ||
zlib/trees.c \ | ||
zlib/uncompr.c \ | ||
zlib/gzlib.c \ | ||
zlib/gzclose.c \ | ||
zlib/gzread.c \ | ||
zlib/gzwrite.c \ | ||
zlib/zutil.c | ||
INCLUDEPATH += zlib | ||
HEADERS += zlib/crc32.h \ | ||
zlib/deflate.h \ | ||
zlib/gzguts.h \ | ||
zlib/inffast.h \ | ||
zlib/inffixed.h \ | ||
zlib/inflate.h \ | ||
zlib/inftrees.h \ | ||
zlib/trees.h \ | ||
zlib/zconf.h \ | ||
zlib/zlib.h \ | ||
zlib/zutil.h | ||
} else:equals(WITH_ZLIB, custom) { | ||
message("zlib is enabled but but must be manually configured") | ||
message(" e.g. qmake WITH_ZLIB=custom LIBS+=... INCLUDEPATH+=...") | ||
DEFINES += HAVE_LIBZ | ||
} else { | ||
error("WITH_ZLIB=no|pkgconfig|included*|custom"); | ||
} | ||
} |