summaryrefslogtreecommitdiff
path: root/Utilities/cmcurl
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-07-17 14:00:01 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2019-07-18 11:10:36 -0400
commitdd3e4767863dfe1307d4dccd2445e5312b55473e (patch)
treef9866d982850b89c9cef725f9390951074d4d857 /Utilities/cmcurl
parente3bd5c5b666e515319d81f8218e2f71c11169304 (diff)
downloadcmake-dd3e4767863dfe1307d4dccd2445e5312b55473e.tar.gz
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.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 37522fc10a..bc8a7dc37b 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)