Fix MOC defines for cmake-2.4. This fixes building without OpenSSL and cmake-2.4
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 1 Sep 2008 20:46:04 +0000 (22:46 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 1 Sep 2008 20:48:40 +0000 (22:48 +0200)
Also making OpenSSL and D-Bus detection slightly more verbose.

CMakeLists.txt
cmake/modules/FindQt4.cmake

index 69945fc..04aa07a 100644 (file)
@@ -126,24 +126,38 @@ set(QT_DONT_USE_QTGUI 1)
 include(${QT_USE_FILE})
 include_directories(${QT_INCLUDES})
 
-# Set up OpenSSL
+# Setup OpenSSL
 if(WITH_OPENSSL)
   find_package(OpenSSL)
+else(WITH_OPENSSL)
+  message(STATUS "Disabling OpenSSL support")
 endif(WITH_OPENSSL)
+
 if(OPENSSL_FOUND)
   if(NOT QT_DEFINITIONS MATCHES "QT_NO_OPENSSL")
+    message(STATUS "Found OpenSSL support in Qt")
     add_definitions(-DHAVE_SSL)
     set(HAVE_SSL true)
+  else(NOT QT_DEFINITIONS MATCHES "QT_NO_OPENSSL")
+    message(STATUS "No OpenSSL support found in Qt, disabling")
   endif(NOT QT_DEFINITIONS MATCHES "QT_NO_OPENSSL")
 else(OPENSSL_FOUND)
   add_definitions(-DQT_NO_OPENSSL)
 endif(OPENSSL_FOUND)
 
-if(WITH_DBUS AND QT_QTDBUS_FOUND)
-  add_definitions(-DHAVE_DBUS)
-  set(LINK_DBUS DBUS)
-  set(HAVE_DBUS true)
-endif(WITH_DBUS AND QT_QTDBUS_FOUND)
+# Setup D-Bus support
+if(WITH_DBUS)
+  if(QT_QTDBUS_FOUND)
+    message(STATUS "Found QtDBus, enabling D-Bus support")
+    add_definitions(-DHAVE_DBUS)
+    set(LINK_DBUS DBUS)
+    set(HAVE_DBUS true)
+  else(QT_QTDBUS_FOUND)
+    message(STATUS "QtDBus not found, disabling D-Bus support")
+  endif(QT_QTDBUS_FOUND)
+else(WITH_DBUS)
+  message(STATUS "Disabling D-Bus support")
+endif(WITH_DBUS)
 
 # We need to create a version.gen
 # For this, we create our genversion binary and make sure it is run every time.
index 6c1dd86..678cf4a 100644 (file)
@@ -1145,7 +1145,7 @@ IF (QT4_QMAKE_FOUND)
   # Added by Sput to provide definitions to moc calls
   MACRO (QT4_GET_MOC_DEFINES _moc_DEFINES)
      SET(${_moc_DEFINES})
-     GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
+     GET_DIRECTORY_PROPERTY(_defines DEFINITIONS)
      FOREACH(_current ${_defines})
         SET(${_moc_DEFINES} ${${_moc_DEFINES}} -D${_current})
      ENDFOREACH(_current ${_defines})