Browse Source

Build System: Xrandr and Xinerama optional

Philippe Pepiot 15 years ago
parent
commit
ceb97cdae0
2 changed files with 19 additions and 3 deletions
  1. 17 3
      CMakeLists.txt
  2. 2 0
      src/config.h.in

+ 17 - 3
CMakeLists.txt

@@ -96,14 +96,28 @@ include(FindDoxygen)
 include(FindPkgConfig)
 
 # Use pkgconfig to get required libraries
-pkg_check_modules(wmfs_required
+pkg_check_modules(WMFS_REQUIRED REQUIRED
   x11
   libconfuse
   freetype2
-  xinerama
-  xrandr
   xft)
 
+# Check for xinerama
+pkg_check_modules(HAVE_XINERAMA xinerama)
+if(HAVE_XINERAMA_FOUND)
+    set(WMFS_HAVE_XINERAMA "#define HAVE_XINERAMA")
+else()
+    set(WMFS_HAVE_XINERAMA "")
+endif()
+
+# Check for xrandr
+pkg_check_modules(HAVE_XRANDR xrandre)
+if(HAVE_XRANDR_FOUND)
+    set(WMFS_HAVE_XRANDR "#define HAVE_XRANDR")
+else()
+    set(WMFS_HAVE_XRANDR "")
+endif()
+
 # Generating man page
 find_program(GZIP_EXECUTABLE gzip)
 if(NOT GZIP_EXECUTABLE)

+ 2 - 0
src/config.h.in

@@ -41,5 +41,7 @@
 #define WMFS_COMPILE_FLAGS      "@WMFS_COMPILE_FLAGS@"
 #define WMFS_LINKED_LIBS        "@WMFS_LINKED_LIBS@"
 #define XDG_CONFIG_DIR          "@XDG_CONFIG_DIR@"
+@WMFS_HAVE_XINERAMA@
+@WMFS_HAVE_XRANDR@
 
 #endif /* CONFIG_H */