Skip to content

Commit

Permalink
Fix OpenSSL dependencies for Windows (#864)
Browse files Browse the repository at this point in the history
* Fixed OpenSSL dependencies on Windows

* CompileHowto updated
  • Loading branch information
Paulchen-Panther authored Jul 12, 2020
1 parent 69561ae commit 22ace55
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
python -m pip install aqtinstall
python -m aqt install -O c:\Qt 5.15.0 windows desktop win64_msvc2019_64
displayName: 'Install Qt 5.15.0'
# build process
- bash: ./.ci/ci_build.sh
env:
Expand Down
1 change: 1 addition & 0 deletions CompileHowto.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ We assume a 64bit Windows 7 or higher. Install the following
- Open a console window and execute `pip install aqtinstall`.
- Now we can download Qt to _C:\Qt_ `mkdir c:\Qt && aqt install -O c:\Qt 5.15.0 windows desktop win64_msvc2019_64`
- [CMake (Windows win64-x64 Installer)](https://cmake.org/download/) (Check: Add to PATH)
- [Win64 OpenSSL v1.1.1g](https://slproweb.com/products/Win32OpenSSL.html) ([direct link](https://slproweb.com/download/Win64OpenSSL-1_1_1g.exe))
- [Visual Studio 2019 Build Tools](https://go.microsoft.com/fwlink/?linkid=840931) ([direct link](https://aka.ms/vs/16/release/vs_buildtools.exe))
- Select C++ Buildtools
- On the right, just select `MSVC v142 VS 2019 C++ x64/x86-Buildtools` and latest `Windows 10 SDK`. Everything else is not needed.
Expand Down
31 changes: 31 additions & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ macro(DeployWindows TARGET)
if(EXISTS ${TARGET_FILE})
message(STATUS "Collecting Dependencies for target file: ${TARGET_FILE}")
find_package(Qt5Core REQUIRED)
find_package(OpenSSL REQUIRED)

# Find the windeployqt binaries
get_target_property(QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
Expand Down Expand Up @@ -224,6 +225,36 @@ macro(DeployWindows TARGET)
list(REMOVE_AT DEPENDENCIES 0 1)
endwhile()

# Copy OpenSSL Libs
if (OPENSSL_FOUND)
string(REGEX MATCHALL "[0-9]+" openssl_versions "${OPENSSL_VERSION}")
list(GET openssl_versions 0 openssl_version_major)
list(GET openssl_versions 1 openssl_version_minor)

set(library_suffix "-${openssl_version_major}_${openssl_version_minor}")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
string(APPEND library_suffix "-x64")
endif()

find_file(OPENSSL_SSL
NAMES "libssl${library_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)

find_file(OPENSSL_CRYPTO
NAMES "libcrypto${library_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)

install(
FILES ${OPENSSL_SSL} ${OPENSSL_CRYPTO}
DESTINATION "bin"
COMPONENT "Hyperion"
)
endif(OPENSSL_FOUND)

# Create a qt.conf file in 'bin' to override hard-coded search paths in Qt plugins
file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../lib/\n")
install(
Expand Down

0 comments on commit 22ace55

Please sign in to comment.