summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
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 /CMakeLists.txt
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 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 1 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 399e79c2c9..5efa077fd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -429,10 +429,7 @@ macro (CMAKE_BUILD_UTILITIES)
set(_CMAKE_USE_OPENSSL_DEFAULT OFF)
if(NOT DEFINED CMAKE_USE_OPENSSL AND NOT WIN32 AND NOT APPLE
AND CMAKE_SYSTEM_NAME MATCHES "(Linux|FreeBSD)")
- find_package(OpenSSL QUIET)
- if(OPENSSL_FOUND)
- set(_CMAKE_USE_OPENSSL_DEFAULT ON)
- endif()
+ set(_CMAKE_USE_OPENSSL_DEFAULT ON)
endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL." ${_CMAKE_USE_OPENSSL_DEFAULT})
mark_as_advanced(CMAKE_USE_OPENSSL)