diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-07-17 18:00:01 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-07-18 15:10:36 (GMT) |
commit | dd3e4767863dfe1307d4dccd2445e5312b55473e (patch) | |
tree | f9866d982850b89c9cef725f9390951074d4d857 /Utilities/cmcurl | |
parent | e3bd5c5b666e515319d81f8218e2f71c11169304 (diff) | |
download | CMake-dd3e4767863dfe1307d4dccd2445e5312b55473e.zip CMake-dd3e4767863dfe1307d4dccd2445e5312b55473e.tar.gz CMake-dd3e4767863dfe1307d4dccd2445e5312b55473e.tar.bz2 |
OpenSSL: Issue an error if OpenSSL is not found
When building with the built-in Curl, CMAKE_USE_OPENSSL is only set
to ON by default if an OpenSSL installation is detected. However, this
can cause the user to mistakenly build without OpenSSL support if
OpenSSL is not installed, because CMAKE_USE_OPENSSL is set to OFF in
that case. Always set CMAKE_USE_OPENSSL to ON by default on systems
where it could be available, skipping the initial detection, resulting
in an error when we try to use OpenSSL later on. Detect this error
and advise the user to either install OpenSSL or set CMAKE_USE_OPENSSL
to OFF.
Co-Authored-by: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Utilities/cmcurl')
-rw-r--r-- | Utilities/cmcurl/CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 37522fc..bc8a7dc 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -449,7 +449,12 @@ if(CMAKE_USE_SECTRANSP) endif() if(CMAKE_USE_OPENSSL) - find_package(OpenSSL REQUIRED) + find_package(OpenSSL) + if(NOT OpenSSL_FOUND) + message(FATAL_ERROR + "Could not find OpenSSL. Install an OpenSSL development package or " + "configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.") + endif() set(SSL_ENABLED ON) set(USE_OPENSSL ON) set(HAVE_LIBCRYPTO ON) |