Fix OpenSSL on Windows
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 10 Jun 2008 15:10:45 +0000 (17:10 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 10 Jun 2008 15:10:45 +0000 (17:10 +0200)
CMakeLists.txt
src/core/CMakeLists.txt

index 2490abd..e1b2427 100644 (file)
@@ -50,6 +50,13 @@ else(BUILD MATCHES all)
   endif(BUILD MATCHES mono)
 endif(BUILD MATCHES all)
 
+# Enable mostly b0rked stuff (new ChatView), do not enable this unless you know what you do...
+if(SPUTDEV)
+  add_definitions(-DSPUTDEV)
+endif(SPUTDEV)
+
+find_package(OpenSSL)
+
 # Select a Qt installation here, if you don't want to use system Qt
 if(DEFINED QT)
   # FindQt4 will look for the qmake binary in $PATH, so we just prepend the Qt dir
@@ -57,11 +64,6 @@ if(DEFINED QT)
   #SET(QT_QMAKE_EXECUTABLE ${QT}/bin/qmake CACHE FILEPATH "" FORCE)
 endif(DEFINED QT)
 
-# Enable mostly b0rked stuff (new ChatView), do not enable this unless you know what you do...
-if(SPUTDEV)
-  add_definitions(-DSPUTDEV)
-endif(SPUTDEV)
-
 # Now that we have the correct $PATH, lets find Qt!
 find_package(Qt4 REQUIRED)
 
@@ -111,6 +113,9 @@ endif(DEFINED STATIC)
 
 if(STATICWIN AND WIN32)
   link_libraries(imm32 winmm)  # missing by default :/
+  if(OPENSSL_FOUND)
+    link_libraries(libeay32MD ssleay32MD)
+  endif(OPENSSL_FOUND)
 endif(STATICWIN AND WIN32)
 
 if(WIN32)
index 442e105..294fb4c 100644 (file)
@@ -47,12 +47,10 @@ set(HEADERS
 # 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...
-find_package(OpenSSL)
-
-if(OPENSSL_FOUND AND NOT ${QT_DEFINITIONS} MATCHES "-DQT_NO_OPENSSL")
+if(OPENSSL_FOUND AND NOT QT_DEFINITIONS MATCHES "-DQT_NO_OPENSSL")
   set(SOURCES ${SOURCES} sslserver.cpp)
   set(MOC_HDRS ${MOC_HDRS} sslserver.h)
-endif(OPENSSL_FOUND AND NOT ${QT_DEFINITIONS} MATCHES "-DQT_NO_OPENSSL")
+endif(OPENSSL_FOUND AND NOT QT_DEFINITIONS MATCHES "-DQT_NO_OPENSSL")
 
 QT4_WRAP_CPP(MOC ${MOC_HDRS})