From 7b8ac67b0fde804964bc591afab4b0395d485e5d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 25 Mar 2024 21:16:03 +0400 Subject: [PATCH] Move OpenSSL to system directories on Linux Just like done with all other libraries --- external/openssl/CMakeLists.txt | 10 ++-------- external/openssl/openssl_common/CMakeLists.txt | 7 +------ external/openssl/openssl_crypto/CMakeLists.txt | 16 +++++++++++----- external/openssl/openssl_ssl/CMakeLists.txt | 16 +++++++++++----- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/external/openssl/CMakeLists.txt b/external/openssl/CMakeLists.txt index c41e56e..31ea2b3 100644 --- a/external/openssl/CMakeLists.txt +++ b/external/openssl/CMakeLists.txt @@ -8,15 +8,9 @@ add_library(external_openssl INTERFACE IMPORTED GLOBAL) add_library(desktop-app::external_openssl ALIAS external_openssl) if (WIN32) - set(openssl_lib_ext lib) set(openssl_lib_loc ${libs_loc}/openssl3/out) -else() - set(openssl_lib_ext a) - if (APPLE) - set(openssl_lib_loc ${libs_loc}/openssl3) - else() - set(openssl_lib_loc /usr/local/desktop-app/openssl-3.2.1/lib64) - endif() +elseif (APPLE) + set(openssl_lib_loc ${libs_loc}/openssl3) endif() add_subdirectory(openssl_common) diff --git a/external/openssl/openssl_common/CMakeLists.txt b/external/openssl/openssl_common/CMakeLists.txt index 8524222..48e7e1c 100644 --- a/external/openssl/openssl_common/CMakeLists.txt +++ b/external/openssl/openssl_common/CMakeLists.txt @@ -8,12 +8,7 @@ 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-3.2.1/include - ) - else() + if (NOT LINUX) target_include_directories(external_openssl_common SYSTEM INTERFACE ${libs_loc}/openssl3/include diff --git a/external/openssl/openssl_crypto/CMakeLists.txt b/external/openssl/openssl_crypto/CMakeLists.txt index 8ffc591..8c1a035 100644 --- a/external/openssl/openssl_crypto/CMakeLists.txt +++ b/external/openssl/openssl_crypto/CMakeLists.txt @@ -16,13 +16,19 @@ endif() 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_crypto PROPERTIES - IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libcrypto.${openssl_lib_ext}" + IMPORTED_LOCATION "${openssl_lib_loc}/libcrypto.${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libcrypto.${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) +elseif (APPLE) + set_target_properties(external_openssl_crypto PROPERTIES + IMPORTED_LOCATION "${openssl_lib_loc}/libcrypto.${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) +else() + find_library(DESKTOP_APP_CRYPTO_LIBRARIES libcrypto.a REQUIRED) + set_target_properties(external_openssl_crypto PROPERTIES + IMPORTED_LOCATION "${DESKTOP_APP_CRYPTO_LIBRARIES}" ) endif() diff --git a/external/openssl/openssl_ssl/CMakeLists.txt b/external/openssl/openssl_ssl/CMakeLists.txt index 4200869..60d0bc2 100644 --- a/external/openssl/openssl_ssl/CMakeLists.txt +++ b/external/openssl/openssl_ssl/CMakeLists.txt @@ -16,13 +16,19 @@ endif() 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}" + IMPORTED_LOCATION "${openssl_lib_loc}/libssl.${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libssl.${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) +elseif (APPLE) + set_target_properties(external_openssl_ssl PROPERTIES + IMPORTED_LOCATION "${openssl_lib_loc}/libssl.${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) +else() + find_library(DESKTOP_APP_SSL_LIBRARIES libssl.a REQUIRED) + set_target_properties(external_openssl_ssl PROPERTIES + IMPORTED_LOCATION "${DESKTOP_APP_SSL_LIBRARIES}" ) endif()