Source: zpspell
Version: 0.4.3-4.1
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

zpspell fails to cross build from source, because it uses an unsupported
cmake <-> pkg-config integration mechanism. cmake even warns about that
and during cross builds it fails to find the relevant packages. Please
consider applying the attached patch to use the industry-standard
pkg-config integration, which happens to just work for cross compilation
and doesn't spill warnings during build.

Helmut
--- zpspell-0.4.3.orig/CMakeLists.txt
+++ zpspell-0.4.3/CMakeLists.txt
@@ -37,71 +37,13 @@
 
 
 # dbus and glib stuff
-include(UsePkgConfig)
-pkgconfig("dbus-glib-1" _dbusIncDir _dbusLinkDir _dbusLinkFlags _dbusCflags)
-pkgconfig("glib-2.0" _glibIncDir _glibLinkDir _glibLinkFlags _glibCflags)
-
-# DBUS_INCLUDE_DIR
-find_path(DBUS_INCLUDE_DIR dbus/dbus-glib.h
-   ${_dbusIncDir}
-   ${_dbusIncDir}/dbus-1.0
-   /usr/include/dbus-1.0
-   /usr/include
-   /usr/local/include/dbus-1.0
-   /usr/local/include
-)
-# DBUS_LIBRARY
-find_library(DBUS_LIBRARY NAMES dbus-1
-    PATHS
-    ${_dbusLinkDir}
-    /usr/lib
-    /usr/local/lib
-)
-
-# GLIB2_INCLUDE_DIR
-find_path(GLIB2_INCLUDE_DIR glib.h
-   ${_glibIncDir}
-   /usr/include
-   /usr/include/glib-2.0
-   /usr/local/include
-)
-# GLIB2_LIBRARY
-find_library(GLIB2_LIBRARY NAMES glib-2.0
-    PATHS
-    ${_glibLinkDir}
-    /usr/lib
-    /usr/local/lib
-)
-# GLIB_CONFIG
-find_path(GLIB_CONFIG_DIR glibconfig.h
-   ${_glibLinkDir}/glib-2.0/include
-   ${_glibLinkDir}/glib-2.0
-   /usr/lib/glib-2.0/include
-   /usr/lib/glib-2.0
-   /usr/include/glib-2.0
-   /usr/local/include
-)
-
-
-if(DBUS_LIBRARY AND DBUS_INCLUDE_DIR)
-        message(STATUS "Found DBUS_LIBRARY: ${DBUS_LIBRARY}")
-        message(STATUS "Found DBUS_INCLUDE_DIR: ${DBUS_INCLUDE_DIR}")
-else(DBUS_LIBRARY AND DBUS_INCLUDE_DIR)
-        message(FATAL_ERROR "Can't find DBUS")
-endif(DBUS_LIBRARY AND DBUS_INCLUDE_DIR)
-
-if(GLIB2_LIBRARY AND GLIB2_INCLUDE_DIR)
-        message(STATUS "Found GLIB2_LIBRARY: ${GLIB2_LIBRARY}")
-        message(STATUS "Found GLIB2_INCLUDE_DIR: ${GLIB2_INCLUDE_DIR}")
-else(GLIB2_LIBRARY AND GLIB2_INCLUDE_DIR)
-        message(FATAL_ERROR "Can't find DBUS")
-endif(GLIB2_LIBRARY AND GLIB2_INCLUDE_DIR)
-
+include(FindPkgConfig)
+pkg_check_modules(DBUS_GLIB REQUIRED "dbus-glib-1")
+pkg_check_modules(GLIB REQUIRED "glib-2.0")
 
 # include and link...
-include_directories(${DBUS_INCLUDE_DIR})
-include_directories(${GLIB2_INCLUDE_DIR})
-include_directories(${GLIB_CONFIG_DIR})
+include_directories(${DBUS_GLIB_INCLUDE_DIRS})
+include_directories(${GLIB_INCLUDE_DIRS})
 
-target_link_libraries(zpspell glib-2.0 dbus-glib-1 gobject-2.0)
+target_link_libraries(zpspell ${GLIB_LIBRARIES} ${DBUS_GLIB_LIBRARIES})
 

Reply via email to