File 0001-Fixed-linking-with-Gwenhywfar-4.6.0.patch of Package kmymoney

From 39b998125a4d0903e2d169e66cfce2dde287808f Mon Sep 17 00:00:00 2001
From: Lukasz Maszczynski <lukasz@maszczynski.net>
Date: Fri, 26 Jul 2013 22:51:30 +0200
Subject: [PATCH 1/1] Fixed linking with Gwenhywfar >= 4.6.0

used a list of libraries to link with as reported by pkg-config instead
of hardcoded gwengui-qt4 (in gwenhywfar 4.6.0, gwengui-qt4 is no longer
standalone - it depends on gwengui-cpp)

REVIEW: 111672
---
 cmake/modules/FindGwenhywfar.cmake | 45 ++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/cmake/modules/FindGwenhywfar.cmake b/cmake/modules/FindGwenhywfar.cmake
index 41961e6..526c041 100644
--- a/cmake/modules/FindGwenhywfar.cmake
+++ b/cmake/modules/FindGwenhywfar.cmake
@@ -5,6 +5,8 @@
 #  GWENHYWFAR_LIBRARIES - The libraries needed to use Gwenhywfar
 #  GWENHYWFAR_VERSION = The version of Gwenhywfar as defined in version.h
 
+find_package(PkgConfig)
+
 set(GWENHYWFAR_FOUND FALSE)
 
 if(NOT GWENHYWFAR_MIN_VERSION)
@@ -16,26 +18,27 @@ if(GWENHYWFAR_INCLUDE_DIRS AND GWENHYWFAR_LIBRARIES)
   set(GWENHYWFAR_FIND_QUIETLY TRUE)
 endif(GWENHYWFAR_INCLUDE_DIRS AND GWENHYWFAR_LIBRARIES)
 
-PKG_CHECK_MODULES(GWENHYWFAR gwenhywfar>=${GWENHYWFAR_MIN_VERSION})
-
-if(${GWENHYWFAR_FOUND})
-  PKG_CHECK_MODULES(QT4GUI gwengui-qt4)
-  if (NOT ${QT4GUI_FOUND})
-    set(GWENHYWFAR_FOUND FALSE)
-    unset(GWENHYWFAR_INCLUDE_DIRS)
-    unset(GWENHYWFAR_LIBRARIES)
-    unset(GWENHYWFAR_VERSION)
-    message(STATUS "Gwenhywfar does not have the Q4Banking frontend enabled")
-  endif (NOT ${QT4GUI_FOUND})
-
-  if(${GWENHYWFAR_FOUND})
-    find_library(GWENHYWFAR_GUI_LIBRARY NAMES gwengui-qt4 libgwengui-qt4
-      HINTS ${GWENHYWFAR_LIBRARY_DIRS})
-    if(GWENHYWFAR_GUI_LIBRARY STREQUAL "GWENHYWFAR_GUI_LIBRARY-NOTFOUND")
-      set(GWENHYWFAR_GUI_LIBRARY "")
-    endif(GWENHYWFAR_GUI_LIBRARY STREQUAL "GWENHYWFAR_GUI_LIBRARY-NOTFOUND")
-    set(GWENHYWFAR_LIBRARIES ${GWENHYWFAR_GUI_LIBRARY} ${GWENHYWFAR_LIBRARIES})
-  endif(${GWENHYWFAR_FOUND})
-endif(${GWENHYWFAR_FOUND})
+PKG_CHECK_MODULES(GWENHYWFAR_CORE gwenhywfar>=${GWENHYWFAR_MIN_VERSION})
+PKG_CHECK_MODULES(GWENHYWFAR_QT4GUI gwengui-qt4>=${GWENHYWFAR_MIN_VERSION})
+
+if (${GWENHYWFAR_CORE_FOUND} AND ${GWENHYWFAR_QT4GUI_FOUND})
+  set(GWENHYWFAR_FOUND TRUE)
+  set(GWENHYWFAR_INCLUDE_DIRS ${GWENHYWFAR_CORE_INCLUDE_DIRS})
+  set(GWENHYWFAR_LIBRARIES ${GWENHYWFAR_QT4GUI_LIBRARIES} ${GWENHYWFAR_CORE_LIBRARIES})
+  set(GWENHYWFAR_VERSION ${GWENHYWFAR_CORE_VERSION})
+else (${GWENHYWFAR_CORE_FOUND} AND ${GWENHYWFAR_QT4GUI_FOUND})
+  set(GWENHYWFAR_FOUND FALSE)
+  unset(GWENHYWFAR_INCLUDE_DIRS)
+  unset(GWENHYWFAR_LIBRARIES)
+  unset(GWENHYWFAR_VERSION)
+endif (${GWENHYWFAR_CORE_FOUND} AND ${GWENHYWFAR_QT4GUI_FOUND})
+
+if (NOT ${GWENHYWFAR_QT4GUI_FOUND})
+  message(WARNING "Gwenhywfar does not have the Qt4Banking frontend enabled")
+endif (NOT ${GWENHYWFAR_QT4GUI_FOUND})
+
+if (NOT ${GWENHYWFAR_CORE_VERSION} VERSION_EQUAL ${GWENHYWFAR_QT4GUI_VERSION})
+  message(WARNING "Gwenhywfar libraries versions mismatch")
+endif (NOT ${GWENHYWFAR_CORE_VERSION} VERSION_EQUAL ${GWENHYWFAR_QT4GUI_VERSION})
 
 mark_as_advanced(GWENHYWFAR_INCLUDE_DIRS GWENHYWFAR_LIBRARIES)
-- 
1.8.4
openSUSE Build Service is sponsored by