Improve (hopefully fix) OpenSSL recognition
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 8 Jul 2008 15:01:02 +0000 (17:01 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 8 Jul 2008 15:01:02 +0000 (17:01 +0200)
FindQt4.cmake has a bunch of issues, in particular it ignores if openssl is present.

CMakeLists.txt
cmake/modules/FindQt4.cmake
src/core/CMakeLists.txt

index a8e4666..c6dd28d 100644 (file)
@@ -70,6 +70,9 @@ endif(SPUTDEV)
 
 # Set up OpenSSL
 find_package(OpenSSL)
 
 # 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)
 
 # Select a Qt installation here, if you don't want to use system Qt
 if(QT)
index d778da6..ebd0106 100644 (file)
@@ -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")
     # 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")
   
   ## system png
   IF(QT_QCONFIG MATCHES "system-png")
index 1400710..ef5e09f 100644 (file)
@@ -48,14 +48,13 @@ set(HEADERS
     coresettings.h
     coreusersettings.h)
 
     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})
   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})
 
 
 QT4_WRAP_CPP(MOC ${MOC_HDRS})