summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-05-02 17:37:44 +0200
committerSlávek Banko <slavek.banko@axis.cz>2016-05-02 17:37:44 +0200
commit6134b7ce07f97363a4efe1d87cbac0e3c9b71067 (patch)
treebf4633b34df225f333b92aa4cac0fc98a493bfe8
parenta2159a021bd49e314f891168232ccbc242204a6e (diff)
downloaddigikam-6134b7ce07f97363a4efe1d87cbac0e3c9b71067.tar.gz
digikam-6134b7ce07f97363a4efe1d87cbac0e3c9b71067.zip
Fix gphoto2 library detection
Use pkg-config file, if possible Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--digikam/configure.in.in37
1 files changed, 27 insertions, 10 deletions
diff --git a/digikam/configure.in.in b/digikam/configure.in.in
index 4a83df0..bff2fd9 100644
--- a/digikam/configure.in.in
+++ b/digikam/configure.in.in
@@ -124,18 +124,35 @@ AC_SUBST(LCMS_LIBS)
#
#------------------------------------------------------------------
-AC_PATH_PROG(GPHOTO_CONFIG,gphoto2-config)
-AC_PATH_PROG(GPHOTO_PORT_CONFIG,gphoto2-port-config)
-if test -n "${GPHOTO_CONFIG}"; then
- GPHOTO_VERSION="`$GPHOTO_CONFIG --version`"
- case "${GPHOTO_VERSION}" in "libgphoto2 2.5"*) CXXFLAGS="$CXXFLAGS -DHAVE_GPHOTO25";; esac
- GPHOTO_CFLAGS="`$GPHOTO_CONFIG --cflags`"
+KDE_PKG_CHECK_MODULES(GPHOTO2, libgphoto2 >= 2.5,
+ [have_libgphoto2=yes, have_gphoto25=yes], have_libgphoto2=no)
+if test "x$have_libgphoto2" = "xno"; then
+ KDE_PKG_CHECK_MODULES(GPHOTO2, libgphoto2,
+ have_libgphoto2=yes, have_libgphoto2=no)
+fi
+if test "x$have_libgphoto2" = "xno"; then
+ AC_PATH_PROG(GPHOTO_CONFIG,gphoto2-config)
+ AC_PATH_PROG(GPHOTO_PORT_CONFIG,gphoto2-port-config)
+ if test -n "${GPHOTO_CONFIG}"; then
+ GPHOTO_VERSION="`$GPHOTO_CONFIG --version`"
+ case "${GPHOTO_VERSION}" in "libgphoto2 2.5"*) CXXFLAGS="$CXXFLAGS -DHAVE_GPHOTO25";; esac
+ GPHOTO_CFLAGS="`$GPHOTO_CONFIG --cflags`"
+ AC_SUBST(GPHOTO_CFLAGS)
+ LIB_GPHOTO="`$GPHOTO_CONFIG --libs` `$GPHOTO_PORT_CONFIG --libs`"
+ AC_SUBST(LIB_GPHOTO)
+ else
+ AC_MSG_WARN([gPhoto2 not found.])
+ DO_NOT_COMPILE="digikam $DO_NOT_COMPILE"
+ fi
+else
+ if test "x$have_gphoto25" = "xyes"; then
+ GPHOTO_CFLAGS="$GPHOTO2_CFLAGS -DHAVE_GPHOTO25"
+ else
+ GPHOTO_CFLAGS="$GPHOTO2_CFLAGS"
+ fi
+ LIB_GPHOTO="$GPHOTO2_LIBS"
AC_SUBST(GPHOTO_CFLAGS)
- LIB_GPHOTO="`$GPHOTO_CONFIG --libs` `$GPHOTO_PORT_CONFIG --libs`"
AC_SUBST(LIB_GPHOTO)
-else
- AC_MSG_WARN([gPhoto2 not found.])
- DO_NOT_COMPILE="digikam $DO_NOT_COMPILE"
fi
CXXFLAGS="$CXXFLAGS -DQT_CLEAN_NAMESPACE"