Dennis Heimbigner
Dennis Heimbigner

Reputation: 61

Cygwin appears to install openssl in a non-standard way (for cmake) on windows 10

OS: Cygwin64

I use this command in cmake to find openssl:

find_package(OpenSSL REQUIRED)

It fails complaining:

-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "1.1.1d")

The assumption appears to be that all of the openssl files are under some single directory such as this:

/usr/local/openssl/bin 
/usr/local/openssl/include
/usr/local/openssl/lib
...

But cygwin is installing things more or less as follows:

/usr/local/bin/
/usr/local/lib/
/usr/local/include/openssl

Anyone have an idea about how to get find_package(OpenSSL) to recognize the cygwin layout?

Upvotes: 0

Views: 951

Answers (1)

Dennis Heimbigner
Dennis Heimbigner

Reputation: 61

A co-worker told me to add this flag:

-DOPENSSL_USE_STATIC_LIBS=TRUE

That seems to solve the problem at the apparent expense of using the static library. But I have no idea why this flag works.

Upvotes: -1

Related Questions