From ac089658f3b967f5435f771f86316e0db02dce54 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 17 Nov 2020 22:25:39 +0100 Subject: [PATCH] CMake: Fix error flood if OpenSSL is not present Fixes #1013 --- cmake/macros/PackageConfig.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index b3160e49fe..3ede449be6 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -145,6 +145,8 @@ function(package_option name) endif() endif() + option("HAVE_${name}" "${cache_string}" "${default}") + # If it was set by the user but not found, display an error. string(TOUPPER "${found_as}" FOUND_AS) if(HAVE_${name} AND NOT ${found_as}_FOUND AND NOT ${FOUND_AS}_FOUND) @@ -180,9 +182,7 @@ function(package_option name) "$") endif() - # Create the option, and if it actually is enabled, populate the INTERFACE - # library created above - option("HAVE_${name}" "${cache_string}" "${default}") + # If the option actually is enabled, populate the INTERFACE library created above if(HAVE_${name}) set(use_variables ON)