From 6f25e0913242e30e5564878b753bef06edf6b80d Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 10 Oct 2014 14:12:30 +0200 Subject: [PATCH 1/5] Deploy openssl libraries under win32 They are needed to fetch prices from deckbrew and possibly, in the future, for ssl server connections --- CMakeLists.txt | 7 ++++- cmake/FindWin32SslRuntime.cmake | 52 +++++++++++++++++++++++++++++++++ cockatrice/CMakeLists.txt | 4 +++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 cmake/FindWin32SslRuntime.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 414df9f8..3cd770d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,6 +158,11 @@ set(CMAKE_AUTOMOC TRUE) # Find other needed libraries FIND_PACKAGE(Protobuf REQUIRED) +#Find OpenSSL +IF(WIN32) + FIND_PACKAGE(Win32SslRuntime) +ENDIF() + # Package builder set(CPACK_PACKAGE_CONTACT "Daenyth+github@gmail.com") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME}) @@ -198,7 +203,7 @@ endif() include(CPack) # Compile servatrice (default off) -option(WITH_SERVER "build servatrice" OFF) +option(WITH_SERVER "build servatrice" ON) add_subdirectory(common) if(WITH_SERVER) add_subdirectory(servatrice) diff --git a/cmake/FindWin32SslRuntime.cmake b/cmake/FindWin32SslRuntime.cmake new file mode 100644 index 00000000..616ca83e --- /dev/null +++ b/cmake/FindWin32SslRuntime.cmake @@ -0,0 +1,52 @@ +# Find the openssl runtime libraries (.dll) for windows that +# will be needed by Qt in order to access https urls. + +if (WIN32) + # Get standatds instalaltion paths for openssl under windos + + # http://www.slproweb.com/products/Win32OpenSSL.html + set(_OPENSSL_ROOT_HINTS + ${OPENSSL_ROOT_DIR} + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]" + ENV OPENSSL_ROOT_DIR + ) + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) + set(_OPENSSL_ROOT_PATHS + "${_programfiles}/OpenSSL" + "${_programfiles}/OpenSSL-Win32" + "${_programfiles}/OpenSSL-Win64" + "C:/OpenSSL/" + "C:/OpenSSL-Win32/" + "C:/OpenSSL-Win64/" + ) + unset(_programfiles) +else () + set(_OPENSSL_ROOT_HINTS + ${OPENSSL_ROOT_DIR} + ENV OPENSSL_ROOT_DIR + ) +endif () + +set(_OPENSSL_ROOT_HINTS_AND_PATHS + HINTS ${_OPENSSL_ROOT_HINTS} + PATHS ${_OPENSSL_ROOT_PATHS} + ) + +FIND_FILE(WIN32SSLRUNTIME_LIBEAY NAMES libeay32.dll ${_OPENSSL_ROOT_HINTS_AND_PATHS}) +FIND_FILE(WIN32SSLRUNTIME_SSLEAY NAMES ssleay32.dll ${_OPENSSL_ROOT_HINTS_AND_PATHS}) + + +IF(WIN32SSLRUNTIME_LIBEAY AND WIN32SSLRUNTIME_SSLEAY) + SET(WIN32SSLRUNTIME_LIBRARIES "${WIN32SSLRUNTIME_LIBEAY}" "${WIN32SSLRUNTIME_SSLEAY}") + SET(WIN32SSLRUNTIME_FOUND "YES") + message(STATUS "Found OpenSSL ${WIN32SSLRUNTIME_LIBRARIES}") +ELSE() + SET(WIN32SSLRUNTIME_FOUND "NO") + message(WARNING "Could not find OpenSSL runtime libraries. They are not required for compiling, but needs to be available at runtime.") +ENDIF() + +MARK_AS_ADVANCED( + WIN32SSLRUNTIME_LIBEAY + WIN32SSLRUNTIME_SSLEAY + ) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index 454f1a1f..ed50c41d 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -321,4 +321,8 @@ Data = Resources\") include(BundleUtilities) fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/cockatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") " COMPONENT Runtime) + + if(WIN32SSLRUNTIME_FOUND) + install(FILES ${WIN32SSLRUNTIME_LIBRARIES} DESTINATION "${CMAKE_INSTALL_PREFIX}") + endif() endif() \ No newline at end of file From 90e90b59a318c74e1c5672d7171e7c2d7a7d06ed Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 10 Oct 2014 14:23:31 +0200 Subject: [PATCH 2/5] Reverted WITH_SERVER to OFF --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cd770d6..33c45867 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,7 +203,7 @@ endif() include(CPack) # Compile servatrice (default off) -option(WITH_SERVER "build servatrice" ON) +option(WITH_SERVER "build servatrice" OFF) add_subdirectory(common) if(WITH_SERVER) add_subdirectory(servatrice) From ef7fc01f0820b81673de916726ebb8cacc566d89 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 10 Oct 2014 14:26:52 +0200 Subject: [PATCH 3/5] Fix typos --- cmake/FindWin32SslRuntime.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/FindWin32SslRuntime.cmake b/cmake/FindWin32SslRuntime.cmake index 616ca83e..4b0fafa5 100644 --- a/cmake/FindWin32SslRuntime.cmake +++ b/cmake/FindWin32SslRuntime.cmake @@ -1,8 +1,8 @@ -# Find the openssl runtime libraries (.dll) for windows that +# Find the OpenSSL runtime libraries (.dll) for Windows that # will be needed by Qt in order to access https urls. if (WIN32) - # Get standatds instalaltion paths for openssl under windos + # Get standard installation paths for OpenSSL under Windows # http://www.slproweb.com/products/Win32OpenSSL.html set(_OPENSSL_ROOT_HINTS From dfb8be79cfc35c3a26f185b49f5104166dc736c9 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 10 Oct 2014 17:22:29 +0200 Subject: [PATCH 4/5] Fix installation of libeay32.dll, ssleay32.dll while compiling the PACKAGE target --- cockatrice/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index ed50c41d..e3bcd8fa 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -323,6 +323,6 @@ Data = Resources\") " COMPONENT Runtime) if(WIN32SSLRUNTIME_FOUND) - install(FILES ${WIN32SSLRUNTIME_LIBRARIES} DESTINATION "${CMAKE_INSTALL_PREFIX}") + install(FILES ${WIN32SSLRUNTIME_LIBRARIES} DESTINATION ./) endif() endif() \ No newline at end of file From ea622a7302edef33b26a8f9ee742288b014e4f9a Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 10 Oct 2014 17:22:39 +0200 Subject: [PATCH 5/5] NSIS: uninstall openssl libraries --- cmake/NSIS.template.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/NSIS.template.in b/cmake/NSIS.template.in index 093d6caa..f8fbd920 100644 --- a/cmake/NSIS.template.in +++ b/cmake/NSIS.template.in @@ -80,6 +80,8 @@ Section Uninstall Delete "$INSTDIR\libprotobuf.lib" Delete "$INSTDIR\Qt*.dll" Delete "$INSTDIR\icu*.dll" + Delete "$INSTDIR\libeay32.dll" + Delete "$INSTDIR\ssleay32.dll" Delete "$INSTDIR\qt.conf" Delete "$INSTDIR\qdebug.txt" Delete "$INSTDIR\servatrice.sql"