-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Currently the JWT cmake file uses different ways to find OpenSSL on each platform. This makes the cmake file more complicated than necessary.
Even worse is that the standard way to let cmake find a dependency in a non-system path doesn't work. Normally if I want jwt-cpp to find an OpenSSL library installed in directory /foo/bar, I would include that path in CMAKE_PREFIX_PATH. This currently doesn't work (at least on Linux) because the cmake file uses pkconfig to find OpenSSL unless you define the following 3 (!) cmake variables:
OPENSSL_INCLUDE_DIRS
OPENSSL_LIBRARY_DIRS
OPENSSL_LIBRARIES
Also the conan recipe for jwt-cpp currently doesn't work correctly on Linux, because jwt-cpp ignores the CMAKE_PREFIX_PATH.
I suggest to keep the variables OPENSSL_INCLUDE_DIRS, OPENSSL_LIBRARY_DIRS, OPENSSL_LIBRARIES for backwards compatibility, but if they are not defined then use the normal way:
find_package(OpenSSL)
to find OpenSSL.