1
0
Fork 0

Add missed openssl dependency to qt

This commit is contained in:
Ilya Fedin 2020-07-24 03:10:01 +04:00 committed by John Preston
parent 408083f52e
commit 88c7addb4e
5 changed files with 126 additions and 59 deletions

View file

@ -7,66 +7,28 @@
add_library(external_openssl INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openssl ALIAS external_openssl)
if (DESKTOP_APP_USE_PACKAGED)
find_package(OpenSSL REQUIRED)
target_link_libraries(external_openssl
INTERFACE
OpenSSL::SSL
OpenSSL::Crypto
)
if (WIN32)
set(openssl_lib_ext lib)
set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32)
else()
if (LINUX)
target_include_directories(external_openssl SYSTEM
INTERFACE
/usr/local/desktop-app/openssl-1.1.1/include
)
elseif (NOT APPLE OR NOT build_osx)
target_include_directories(external_openssl SYSTEM
INTERFACE
${libs_loc}/openssl_1_1_1/include
)
else()
target_include_directories(external_openssl SYSTEM
INTERFACE
${libs_loc}/openssl/include
)
endif()
if (WIN32)
set(openssl_lib_ext lib)
set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32$<$<CONFIG:Debug>:.dbg>)
else()
set(openssl_lib_ext a)
if (APPLE)
if (NOT build_osx)
set(openssl_lib_loc ${libs_loc}/openssl_1_1_1)
else()
set(openssl_lib_loc ${libs_loc}/openssl)
endif()
set(openssl_lib_ext a)
if (APPLE)
if (NOT build_osx)
set(openssl_lib_loc ${libs_loc}/openssl_1_1_1)
else()
set(openssl_lib_loc /usr/local/desktop-app/openssl-1.1.1/lib)
set(openssl_lib_loc ${libs_loc}/openssl)
endif()
endif()
target_link_libraries(external_openssl
INTERFACE
${openssl_lib_loc}/libssl.${openssl_lib_ext}
${openssl_lib_loc}/libcrypto.${openssl_lib_ext}
)
if (LINUX)
if (DESKTOP_APP_USE_GLIBC_WRAPS)
target_link_libraries(external_openssl
INTERFACE
desktop-app::linux_glibc_wraps
$<TARGET_FILE:desktop-app::linux_glibc_wraps>
)
endif()
target_link_libraries(external_openssl
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
else()
set(openssl_lib_loc /usr/local/desktop-app/openssl-1.1.1/lib)
endif()
endif()
add_subdirectory(openssl_common)
add_subdirectory(openssl_ssl)
add_subdirectory(openssl_crypto)
target_link_libraries(external_openssl
INTERFACE
desktop-app::external_openssl_ssl
desktop-app::external_openssl_crypto
)

View file

@ -0,0 +1,42 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_openssl_common INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openssl_common ALIAS external_openssl_common)
if (NOT DESKTOP_APP_USE_PACKAGED)
if (LINUX)
target_include_directories(external_openssl_common SYSTEM
INTERFACE
/usr/local/desktop-app/openssl-1.1.1/include
)
elseif (NOT APPLE OR NOT build_osx)
target_include_directories(external_openssl_common SYSTEM
INTERFACE
${libs_loc}/openssl_1_1_1/include
)
else()
target_include_directories(external_openssl_common SYSTEM
INTERFACE
${libs_loc}/openssl/include
)
endif()
if (LINUX)
if (DESKTOP_APP_USE_GLIBC_WRAPS)
target_link_libraries(external_openssl_common
INTERFACE
$<TARGET_FILE:desktop-app::linux_glibc_wraps>
)
endif()
target_link_libraries(external_openssl_common
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

View file

@ -0,0 +1,31 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
if (DESKTOP_APP_USE_PACKAGED)
add_library(external_openssl_crypto INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openssl_crypto ALIAS external_openssl_crypto)
find_package(OpenSSL REQUIRED)
target_link_libraries(external_openssl INTERFACE OpenSSL::Crypto)
else()
add_library(external_openssl_crypto STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_openssl_crypto ALIAS external_openssl_crypto)
set_target_properties(external_openssl_crypto PROPERTIES
IMPORTED_LOCATION "${openssl_lib_loc}/libcrypto.${openssl_lib_ext}"
)
if (WIN32)
set_target_properties(external_openssl_ssl PROPERTIES
IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libcrypto.${openssl_lib_ext}"
)
endif()
target_link_libraries(external_openssl_crypto
INTERFACE
desktop-app::external_openssl_common
)
endif()

View file

@ -0,0 +1,31 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
if (DESKTOP_APP_USE_PACKAGED)
add_library(external_openssl_ssl INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openssl_ssl ALIAS external_openssl_ssl)
find_package(OpenSSL REQUIRED)
target_link_libraries(external_openssl INTERFACE OpenSSL::SSL)
else()
add_library(external_openssl_ssl STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_openssl_ssl ALIAS external_openssl_ssl)
set_target_properties(external_openssl_ssl PROPERTIES
IMPORTED_LOCATION "${openssl_lib_loc}/libssl.${openssl_lib_ext}"
)
if (WIN32)
set_target_properties(external_openssl_ssl PROPERTIES
IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libssl.${openssl_lib_ext}"
)
endif()
target_link_libraries(external_openssl_ssl
INTERFACE
desktop-app::external_openssl_common
)
endif()

View file

@ -302,6 +302,8 @@ else()
target_link_libraries(external_qt
INTERFACE
${qt_libs_list}
$<TARGET_FILE:desktop-app::external_openssl_ssl>
$<TARGET_FILE:desktop-app::external_openssl_crypto>
)
if (LINUX)
@ -355,7 +357,6 @@ else()
if (DESKTOP_APP_USE_GLIBC_WRAPS)
target_link_libraries(external_qt
INTERFACE
desktop-app::linux_glibc_wraps
$<TARGET_FILE:desktop-app::linux_glibc_wraps>
)
endif()