Skip to content

cpprest_find_openssl.cmake does not allow for custom path to OpenSSL #1433

Open
@LedWork

Description

@LedWork

In this PR #1344 file cpprest_find_openssl.cmake was updated to use find_package(PkgConfig) to search for OpenSSL on the system. However, it looks like this solution does not allow for providing custom path using environment variable OPENSSL_ROOT_DIR which was available before.

In other words, if someone was using custom path to OpenSSL, after updating CppRestSDK to v2.10.16 the linking will most likely succeed but now it will link to system-installed libraries (which may be in different version than desired). The error then may appear in runtime.

I'd propose a fix similar to what's done for APPLE:

if(UNIX)
    if(NOT DEFINED OPENSSL_ROOT_DIR)
        find_package(PkgConfig)
        pkg_search_module(OPENSSL openssl)
    endif()
endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions