janbar / openssl-cmake

Build OpenSSL with CMake on MacOS, Win32, Win64 and cross compile for Android, IOS
Other
275 stars 142 forks source link

Does it working with CPM? #34

Open hks2002 opened 9 months ago

hks2002 commented 9 months ago

In my project, it will stop at the download process. Is someone have the success use with CPM cpmfindpackage()?

jmigual commented 5 months ago

Yes, I have been successful, here's how I import it with CPM:

CPMAddPackage(
  NAME OpenSSL
  GITHUB_REPOSITORY janbar/openssl-cmake
  GIT_TAG 1.1.1w-20231130
  OPTIONS "WITH_APPS OFF"
  EXCLUDE_FROM_ALL YES
  SYSTEM YES
)
Dargun commented 2 weeks ago

if you try to find with find_package(OpenSSL REQUIRED) you will get this error

Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the [cmake] system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)