Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenSSL dependencies for Windows #864

Merged
merged 2 commits into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -178,6 +178,7 @@ macro(DeployWindows TARGET)

if(EXISTS ${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 @@ -226,6 +227,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