Libpng config.tests: use pkg-config when available

Add pkg-config to the libpng usages as not all systems have the
symlink libpng.so -> libpng<version>.so (affected: NetBSD) that changes
with the version of the lib. If no-pkg-config is used, use -lpng as
before. Tested with FreeBSD 10.3, NetBSD 7.0.1 using png 1.6.21

Change-Id: I5c87f380c84da3d5c56c94da53adb900791c8caa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Ralf Nolden 2016-06-24 22:33:31 +02:00
parent 0c44f26fae
commit 1a96295755
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,8 @@
SOURCES = libpng.cpp
CONFIG -= qt dylib
LIBS += -lpng
!contains(QT_CONFIG, no-pkg-config) {
CONFIG += link_pkgconfig
PKGCONFIG += libpng
} else {
LIBS += -lpng
}

View File

@ -1,6 +1,14 @@
contains(QT_CONFIG, system-png) {
unix|mingw: LIBS_PRIVATE += -lpng
else: LIBS += libpng.lib
unix|mingw {
!contains(QT_CONFIG, no-pkg-config) {
CONFIG += link_pkgconfig
PKGCONFIG_PRIVATE += libpng
} else {
LIBS_PRIVATE += -lpng
}
} else {
LIBS += libpng.lib
}
} else: contains(QT_CONFIG, png) {
include($$PWD/libpng.pri)
}