From: Manuel Nickschas Date: Mon, 1 Sep 2008 20:46:04 +0000 (+0200) Subject: Fix MOC defines for cmake-2.4. This fixes building without OpenSSL and cmake-2.4 X-Git-Tag: 0.3.1~304 X-Git-Url: https://git.quassel-irc.org/?a=commitdiff_plain;h=b2fe17d9e5973684c7c965c614309970d64c817b;p=quassel.git Fix MOC defines for cmake-2.4. This fixes building without OpenSSL and cmake-2.4 Also making OpenSSL and D-Bus detection slightly more verbose. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 69945fc9..04aa07ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. diff --git a/cmake/modules/FindQt4.cmake b/cmake/modules/FindQt4.cmake index 6c1dd86c..678cf4a5 100644 --- a/cmake/modules/FindQt4.cmake +++ b/cmake/modules/FindQt4.cmake @@ -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})