Bläddra i källkod

Build System: Re set LIBRARIES_TO_LINK
with Xinerama and Xrandr optional

Philippe Pepiot 15 år sedan
förälder
incheckning
21c5c36c1e
2 ändrade filer med 13 tillägg och 13 borttagningar
  1. 1 1
      .gitignore
  2. 12 12
      CMakeLists.txt

+ 1 - 1
.gitignore

@@ -7,7 +7,7 @@ Makefile
 .*.sw?
 wmfs
 src/config.h
-CHANGELOG
+changelog
 config.h
 #*
 \#*

+ 12 - 12
CMakeLists.txt

@@ -79,17 +79,7 @@ set(LIBRARIES_TO_LINK
   ${FREETYPE_LIBRARIES}
   ${X11_LIBRARIES}
   confuse
-  Xft
-  Xinerama
-  Xrandr)
-
-target_link_libraries(wmfs ${LIBRARIES_TO_LINK})
-
-# Messages
-message("Project version: ${VERSION}")
-message("Using these CFLAGS: ${CFLAGS}")
-message("Using these LDFLAGS: ${LDFLAGS}")
-message("Linking with theses libraries : ${LIBRARIES_TO_LINK}")
+  Xft)
 
 # Includes
 include(FindDoxygen)
@@ -106,18 +96,28 @@ pkg_check_modules(WMFS_REQUIRED REQUIRED
 pkg_check_modules(HAVE_XINERAMA xinerama)
 if(HAVE_XINERAMA_FOUND)
     set(WMFS_HAVE_XINERAMA "#define HAVE_XINERAMA")
+    set(LIBRARIES_TO_LINK ${LIBRARIES_TO_LINK} Xinerama)
 else()
     set(WMFS_HAVE_XINERAMA "")
 endif()
 
 # Check for xrandr
-pkg_check_modules(HAVE_XRANDR xrandre)
+pkg_check_modules(HAVE_XRANDR xrandr)
 if(HAVE_XRANDR_FOUND)
     set(WMFS_HAVE_XRANDR "#define HAVE_XRANDR")
+    set(LIBRARIES_TO_LINK ${LIBRARIES_TO_LINK} Xrandr)
 else()
     set(WMFS_HAVE_XRANDR "")
 endif()
 
+target_link_libraries(wmfs ${LIBRARIES_TO_LINK})
+
+# Messages
+message("Project version: ${VERSION}")
+message("Using these CFLAGS: ${CFLAGS}")
+message("Using these LDFLAGS: ${LDFLAGS}")
+message("Linking with theses libraries : ${LIBRARIES_TO_LINK}")
+
 # Generating man page
 find_program(GZIP_EXECUTABLE gzip)
 if(NOT GZIP_EXECUTABLE)