ChangeLog++
[quassel.git] / CMakeLists.txt
index 60da133..2a7d0fc 100644 (file)
@@ -3,7 +3,9 @@
 # -DWANT_(CORE|QTCLIENT|MONO)=(ON|OFF)
 #                     : select binaries to build
 # -DWITH_OPENSSL=OFF  : Disable OpenSSL support
-# -DWITH_DBUS=OFF     : Disable D-Bus support
+# -DWITH_DBUS=OFF     : Disable D-Bus support (dbus notifications)
+# -DWITH_WEBKIT=OFF   : Disable WebKit support (link previews)
+# -DWITH_PHONON=OFF   : Disable Phonon support (audio notifications)
 # -DOXYGEN_ICONS=(Builtin|External)  : If "Builtin" (the default), compile our Oxygen Icon Theme subset into the binary
 #                                    : If "External", we assume Oxygen is already installed on the system
 # -DQUASSEL_ICONS=(Builtin|External) : If "Builtin" (the default), put our own icons into the binary
@@ -29,11 +31,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
 # Various options and variables that can be set on the command line
 option(WANT_CORE     "Build the core (server) binary"           ON)
 option(WANT_QTCLIENT "Build the Qt4 GUI client binary"          ON)
-option(WANT_MONO     "Build the monolithic (all-in-one) binary" OFF)
+option(WANT_MONO     "Build the monolithic (all-in-one) binary" ON)
 
 option(WITH_OPENSSL  "Enable OpenSSL support if present on the system" ON)
 option(WITH_DBUS     "Enable D-Bus support if present on the system"   ON)
-option(WITH_WEBKIT   "Enable WebKit support if present on the system"  ON)
+option(WITH_WEBKIT   "Enable WebKit support (for link previews)"       ON)
+option(WITH_PHONON   "Enable Phonon support (for audio notifications)" ON)
 
 option(STATIC        "Enable static building (might not be portable)" OFF)
 option(DEPLOY        "Mac OS X only! Adds required libs to bundle resources and create a dmg. Note: requires Qt to be built with 10.4u SDK" OFF)
@@ -149,6 +152,20 @@ else(WITH_WEBKIT)
   message(STATUS "Disabling WebKit support")
 endif(WITH_WEBKIT)
 
+# Setup Phonon support
+if(WITH_PHONON)
+  find_package(Phonon)
+  if(PHONON_FOUND)
+    message(STATUS "Enabling Phonon support")
+    add_definitions(-DHAVE_PHONON)
+    set(HAVE_PHONON true)
+    set(MOC_DEFINES ${MOC_DEFINES} -DHAVE_PHONON)
+  else(PHONON_FOUND)
+    message(STATUS "Phonon not found, disabling audio notifications")
+  endif(PHONON_FOUND)
+else(WITH_PHONON)
+  message(STATUS "Disabling Phonon support")
+endif(WITH_PHONON)
 
 # Set global buildflags
 # This is very much non-portable, so don't use -DSTATIC until you know what
@@ -161,12 +178,14 @@ if(STATIC AND CMAKE_COMPILER_IS_GNUCXX)
   endif(HAVE_SSL)
 endif(STATIC AND CMAKE_COMPILER_IS_GNUCXX)
 
-if(STATIC AND WIN32)
-  link_libraries(imm32 winmm)  # missing by default :/
-   if(HAVE_SSL)
+if(WIN32)
+  #if(STATIC)
+  link_libraries(imm32 winmm dbghelp)  # missing by default :/
+  #endif(STATIC)
+  if(HAVE_SSL)
      link_libraries(${OPENSSL_LIBRARIES} libeay32MD)
-   endif(HAVE_SSL)
-endif(STATIC AND WIN32)
+  endif(HAVE_SSL)
+endif(WIN32)
 
 if(WIN32)
   set(RC_WIN32 ../pics/win32.rc)  # for app icons on windows
@@ -184,7 +203,7 @@ target_link_libraries(genversion ${QT_LIBRARIES} ${QT_CORE_LIB_DEPENDENCIES})
 
 get_target_property(GENVERSION_EXECUTABLE genversion LOCATION)
 add_custom_target(genversion_run ALL ${GENVERSION_EXECUTABLE}
-                  ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/common/version.gen)
+                  ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/version.gen)
 add_dependencies(genversion_run genversion)
 
 # Decide what to do with icons
@@ -217,7 +236,3 @@ add_subdirectory(icons)
 #add_subdirectory(pics)
 add_subdirectory(i18n)
 add_subdirectory(src)
-
-# Make sure version.gen exists before building mod_common
-# TODO: make only main.cpp depend on that! Recompiles suck...
-add_dependencies(mod_common genversion_run)