Skip to content

Commit

Permalink
Merge pull request #1550 from fpagliughi/fix-ssl-dir
Browse files Browse the repository at this point in the history
Small cleanup of OpenSSL/LibreSSL CMake (2nd try)
  • Loading branch information
icraggs authored Dec 30, 2024
2 parents 4688f42 + 68c48f1 commit 9127790
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ project("Eclipse Paho C"
message(STATUS "CMake version: " ${CMAKE_VERSION})
message(STATUS "CMake system name: " ${CMAKE_SYSTEM_NAME})

set(CMAKE_SCRIPTS "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
set(CMAKE_SCRIPTS "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")

## Project Version
## Previously we read in the version from these files, but now we use the
Expand Down
17 changes: 7 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,17 @@ install(

if(PAHO_WITH_SSL OR PAHO_WITH_LIBRESSL)
if(PAHO_WITH_LIBRESSL)
set(LIBRESSL_ROOT_DIR "" CACHE PATH "Directory containing LibreSSL libraries and includes")
find_package(LibreSSL REQUIRED)
set(SSL_INCLUDE_DIR ${LIBRESSL_INCLUDE_DIR} CACHE PATH "Directory containing SSL includes")
set(SSL_LIBRARY_NAME LibreSSL CACHE STRING "Name of the used SSL library")
set(SSL_ROOT_DIR ${LIBRESSL_ROOT_DIR} CACHE PATH "Directory containing SSL libraries and includes")
set(SSL_LIBRARY_NAME LibreSSL)
set(SSL_INCLUDE_DIR ${LIBRESSL_INCLUDE_DIR})
set(SSL_ROOT_DIR ${LIBRESSL_ROOT_DIR})
else()
set(OPENSSL_ROOT_DIR "" CACHE PATH "Directory containing OpenSSL libraries and includes")
find_package(OpenSSL REQUIRED)
set(SSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR} CACHE PATH "Directory containing SSL includes")
set(SSL_LIBRARY_NAME OpenSSL CACHE STRING "Name of the used SSL library")
set(SSL_ROOT_DIR ${OPENSSL_ROOT_DIR} CACHE PATH "Directory containing SSL libraries and includes")
set(SSL_LIBRARY_NAME OpenSSL)
set(SSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR})
set(SSL_ROOT_DIR ${OPENSSL_ROOT_DIR})
endif()
message("Use ${SSL_LIBRARY_NAME} at ${SSL_ROOT_DIR}")
message("SSL_INCLUDE_DIR: ${SSL_INCLUDE_DIR} ${LIBRESSL_SSL_LIBRARY} ${LIBRESSL_CRYPTO_LIBRARY}")
message(STATUS "Using ${SSL_LIBRARY_NAME} with headers at ${SSL_INCLUDE_DIR}")

if(PAHO_BUILD_SHARED)
## common compilation for libpaho-mqtt3cs and libpaho-mqtt3as
Expand Down

0 comments on commit 9127790

Please sign in to comment.