From: Manuel Nickschas Date: Tue, 8 Jul 2008 15:01:02 +0000 (+0200) Subject: Improve (hopefully fix) OpenSSL recognition X-Git-Tag: 0.3.0~295 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=e0014404a0bade964151fb589a568ad40ec25992 Improve (hopefully fix) OpenSSL recognition FindQt4.cmake has a bunch of issues, in particular it ignores if openssl is present. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a8e46664..c6dd28dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,9 @@ endif(SPUTDEV) # Set up OpenSSL find_package(OpenSSL) +if(NOT OPENSSL_FOUND) + add_definitions(-DQT_NO_OPENSSL) +endif(NOT OPENSSL_FOUND) # Select a Qt installation here, if you don't want to use system Qt if(QT) diff --git a/cmake/modules/FindQt4.cmake b/cmake/modules/FindQt4.cmake index d778da6f..ebd01062 100644 --- a/cmake/modules/FindQt4.cmake +++ b/cmake/modules/FindQt4.cmake @@ -1456,6 +1456,11 @@ IF (QT4_QMAKE_FOUND) # Trolltech said they'd consider exporting it for all platforms in future releases. SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_SHARED) ENDIF(NOT QT_CONFIG MATCHES "static") + + # OpenSSL + IF(NOT QT_QCONFIG MATCHES "openssl") + SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_NO_OPENSSL) + ENDIF(NOT QT_QCONFIG MATCHES "openssl") ## system png IF(QT_QCONFIG MATCHES "system-png") diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 14007102..ef5e09f1 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -48,14 +48,13 @@ set(HEADERS coresettings.h coreusersettings.h) -# QT_DEFINITIONS actually does not work, stuff gets included always. -# Funny enough that does not seem to be harmful, but we should still find a way to figure out -# if we have openssl in Qt... -if(OPENSSL_FOUND AND NOT QT_DEFINITIONS MATCHES "-DQT_NO_OPENSSL") +message(${QT_DEFINITIONS}) +if(OPENSSL_FOUND AND NOT QT_DEFINITIONS MATCHES "QT_NO_OPENSSL") + message("found") set(SOURCES ${SOURCES} sslserver.cpp) set(MOC_HDRS ${MOC_HDRS} sslserver.h) include_directories(${OPENSSL_INCLUDE_DIR}) -endif(OPENSSL_FOUND AND NOT QT_DEFINITIONS MATCHES "-DQT_NO_OPENSSL") +endif(OPENSSL_FOUND AND NOT QT_DEFINITIONS MATCHES "QT_NO_OPENSSL") QT4_WRAP_CPP(MOC ${MOC_HDRS})