Use Snore only if building without KDE
[quassel.git] / CMakeLists.txt
index c09b974..42bacd8 100644 (file)
@@ -152,7 +152,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
   endif()
 
   # Just for miniz
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -fno-strict-aliasing")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-undef -fno-strict-aliasing")
 endif(CMAKE_COMPILER_IS_GNUCXX)
 
 # ... and for Clang
@@ -164,7 +164,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
 
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -fno-strict-aliasing")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-undef -fno-strict-aliasing")
 endif()
 
 # Mac build stuff
@@ -242,6 +242,21 @@ if(QT_LRELEASE_EXECUTABLE)
 endif(QT_LRELEASE_EXECUTABLE)
 
 
+# zlib for compression, however we can always fall back to miniz
+find_package(ZLIB)
+if(ZLIB_FOUND)
+  message(STATUS "Using system zlib for compression")
+  add_definitions(-DHAVE_ZLIB)
+  include_directories(${ZLIB_INCLUDE_DIRS})
+  set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${ZLIB_LIBRARIES})
+else()
+  message(STATUS "zlib NOT found, using bundled miniz for compression")
+  if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
+    message(STATUS "WARNING: This may be slow on 32 bit systems!")
+  endif()
+endif()
+
+
 # Execinfo is needed for generating backtraces
 find_package(ExecInfo)
 if(EXECINFO_FOUND)
@@ -382,6 +397,13 @@ if(BUILD_GUI)
     else(WITH_PHONON)
       message(STATUS "Not enabling Phonon support")
     endif(WITH_PHONON)
+
+    find_package(Libsnore)
+    if(LIBSNORE_FOUND)
+        add_definitions(-DHAVE_LIBSNORE)
+        set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${LIBSNORE_LIBRARIES})
+        set(HAVE_SNORENOTIFY true)
+    endif(LIBSNORE_FOUND)
   endif(NOT HAVE_KDE)
 
   # Setup libindicate-qt support
@@ -410,13 +432,6 @@ if(BUILD_GUI)
       /System/Library/Frameworks/Foundation.framework
     )
   endif()
-
-find_package(Libsnore)
-if(LIBSNORE_FOUND)
-    add_definitions(-DHAVE_LIBSNORE -DLIBSNORE_PLUGIN_PATH="${LIBSNORE_PLUGIN_PATH}")
-    set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${LIBSNORE_LIBRARIES})
-    set(HAVE_SNORENOTIFY true)
-endif(LIBSNORE_FOUND)
 endif(BUILD_GUI)
 
 # Core-only deps