Skip to content

Commit

Permalink
Openssl v1.1.1 required for Qt 5.15 is no longer available in Qt tools
Browse files Browse the repository at this point in the history
  • Loading branch information
elecpower committed Oct 30, 2023
1 parent 2a7427d commit 268381b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/win-cpn-32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ jobs:
cache-key-prefix: 'install-qt-action-win32'
version: ${{ env.QT_VERSION }}
arch: ${{ env.MINGW_VERSION }}
tools: 'tools_openssl_x86'

- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -80,7 +79,6 @@ jobs:
run: |
mkdir output && \
CMAKE_PREFIX_PATH=$RUNNER_WORKSPACE/Qt/$QT_VERSION/$MINGW_PATH \
QT_TOOLS_OPENSSL_ROOT_PATH=$RUNNER_WORKSPACE/Qt/Tools/OpenSSL/Win_x86 \
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
- name: Compose release filename
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/win_cpn-64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:
cache-key-prefix: 'install-qt-action-win64'
version: ${{ env.QT_VERSION }}
arch: ${{ env.MINGW_VERSION }}
tools: 'tools_openssl_x64'

- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -94,7 +93,6 @@ jobs:
run: |
mkdir output && \
CMAKE_PREFIX_PATH=$RUNNER_WORKSPACE/Qt/$QT_VERSION/$MINGW_PATH \
QT_TOOLS_OPENSSL_ROOT_PATH=$RUNNER_WORKSPACE/Qt/Tools/OpenSSL/Win_x64 \
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
- name: Compose release filename
Expand Down
7 changes: 7 additions & 0 deletions cmake/NativeTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ if(LIBUSB1_FOUND)
find_package(Dfuutil)
endif()

find_package(OpenSSL)

# Qt 5.15 requires specific version of OpenSSL
if(OPENSSL_FOUND AND OPENSSL_VERSION VERSION_GREATER_EQUAL "1.2.0")
message(STATUS "OpenSSL ${OPENSSL_VERSION} found. Qt 5.15 requires version 1.1.1!")
endif()

# Windows-specific includes and libs shared by sub-projects
if(WIN32)
list(APPEND WIN_INCLUDE_DIRS "${RADIO_SRC_DIR}/thirdparty/windows/dirent")
Expand Down
14 changes: 2 additions & 12 deletions companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,6 @@ if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD) # https://cmake.org/cmake/help/v3.0/policy/CMP0026.html
endif()

# OpenSSL
# environment variable set in github workflows and build-edgetx Dockerfile
if (DEFINED ENV{QT_TOOLS_OPENSSL_ROOT_PATH})
set(OPENSSL_ROOT_DIR "$ENV{QT_TOOLS_OPENSSL_ROOT_PATH}")
else()
message(STATUS "Environment variable QT_TOOLS_OPENSSL_ROOT_PATH not defined. Performing default OpenSSL library search.")
endif()

find_package(OpenSSL)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "install " ${CMAKE_BINARY_DIR} " to " ${CMAKE_INSTALL_PREFIX})
install(TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
Expand All @@ -354,7 +344,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d RENAME 45-companion${APP_NAME_SUFFIX}-taranis.rules)
install(FILES ../targets/linux/45-usbasp.rules DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d RENAME 45-companion${APP_NAME_SUFFIX}-usbasp.rules)

if (OPENSSL_FOUND)
if(OPENSSL_FOUND AND OPENSSL_VERSION VERSION_LESS "1.2.0")
get_filename_component(OPENSSL_SSL_LIBRARY_DIR ${OPENSSL_SSL_LIBRARY} DIRECTORY)
# install only files Qt networking requires
install(DIRECTORY ${OPENSSL_SSL_LIBRARY_DIR}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib FILES_MATCHING PATTERN "engines*" EXCLUDE PATTERN "pkg*" EXCLUDE PATTERN "*.so*")
Expand Down Expand Up @@ -420,7 +410,7 @@ elseif(WIN32)
message(WARNING "Installer: SDL2.dll not found, set SDL2_LIBRARY_PATH manually.")
endif()

if (OPENSSL_FOUND)
if(OPENSSL_FOUND)
get_filename_component(OPENSSL_SSL_LIBRARY_DIR ${OPENSSL_SSL_LIBRARY} DIRECTORY)
set(OPENSSL_BIN_DIR "${OPENSSL_SSL_LIBRARY_DIR}/../bin")
if (EXISTS "${OPENSSL_BIN_DIR}")
Expand Down

0 comments on commit 268381b

Please sign in to comment.