xfconf-plugin: Add library checks for the cmake module
@@ -10,30 +10,67 @@ if (XFCONF_INCLUDE_DIR) # Already in cache, be silent.
set (XFCONF_FIND_QUIETLY TRUE)
endif (XFCONF_INCLUDE_DIR)
-find_package (PkgConfig REQUIRED)
-pkg_search_module (GLIB REQUIRED glib-2.0)
-pkg_search_module (GOBJECT REQUIRED gobject-2.0)
+find_package (PkgConfig QUIET)
+
+if (NOT PkgConfig_FOUND)
+ message ("PkgConfig is required to locate xfconf")
+ return ()
+endif ()
+
+pkg_search_module (GLIB QUIET glib-2.0)
+
+if (NOT GLIB_FOUND)
+ message ("glib-2.0 is required to xfconf")
+ return ()
+endif ()
+
+pkg_search_module (GOBJECT QUIET gobject-2.0)
+
+if (NOT GOBJECT_FOUND)
+ message ("gobject-2.0 is required to xfconf")
+ return ()
+endif ()
find_path (
XFCONF_INCLUDE_DIR
NAMES xfconf
PATHS /usr/include/xfce4/xfconf-0 /usr/local/include/xfce4/xfconf-0)
+if (XFCONF_INCLUDE_DIR-NOTFOUND)
+ message ("xfconf headers cannot be found")
+ return ()
+endif ()
+
find_library (
XFCONF_LIBRARY
NAMES xfconf-0
PATHS /usr/lib /usr/lib64 /usr/local/lib)
+if (XFCONF_LIBRARY-NOTFOUND)
+ message ("xfconf library cannot be found")
+ return ()
+endif ()
+
find_library (
GLIB_LIBRARY
NAMES glib-2.0
PATHS "${GLIB_LIBDIR}")
+if (GLIB_LIBRARY-NOTFOUND)
+ message ("glib library cannot be found")
+ return ()
+endif ()
+
find_library (
GOBJECT_LIBRARY
NAMES gobject-2.0
PATHS "${GOBJECT_LIBDIR}")
+if (GOBJECT_LIBRARY-NOTFOUND)
+ message ("gobject library cannot be found")
+ return ()
+endif ()
+
file (GLOB XFCONF_INCLUDE_DIRS "${XFCONF_INCLUDE_DIR}" "${GLIB_INCLUDEDIR}/glib-2.0" "${GLIB_LIBDIR}/glib-2.0/include")
file (GLOB XFCONF_LIBRARIES "${XFCONF_LIBRARY}" "${GLIB_LIBRARY}" "${GOBJECT_LIBRARY}")
