summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenSSL.cmake
diff options
context:
space:
mode:
authorKai Pastor <dg0yt@darc.de>2024-08-07 18:11:41 (GMT)
committerKai Pastor <dg0yt@darc.de>2024-08-07 18:11:43 (GMT)
commit25b947589a165a4bba486842dd11bfb3217b146e (patch)
tree54a33fc4700e21206c745368baae24230dbfde4c /Modules/FindOpenSSL.cmake
parentaa6b2180bf9926e62641871908ae059c19ddb3a3 (diff)
downloadCMake-25b947589a165a4bba486842dd11bfb3217b146e.zip
CMake-25b947589a165a4bba486842dd11bfb3217b146e.tar.gz
CMake-25b947589a165a4bba486842dd11bfb3217b146e.tar.bz2
Modules: Guard calls to pkg_check_modules
Before calling pkg_check_modules, modules must check PKG_CONFIG_FOUND. When FindPkgConfig.cmake is loaded, pkg_check_modules is always defined regardless of pkg-config being present. However, the whole module might be disabled on user request with CMAKE_DISABLE_FIND_PACKAGE_PkgConfig. This must not break Find modules which just look for a hint or similar.
Diffstat (limited to 'Modules/FindOpenSSL.cmake')
-rw-r--r--Modules/FindOpenSSL.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 01b18f3..33a0765 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -207,7 +207,9 @@ endfunction()
if (UNIX)
find_package(PkgConfig QUIET)
- pkg_check_modules(_OPENSSL QUIET openssl)
+ if(PKG_CONFIG_FOUND)
+ pkg_check_modules(_OPENSSL QUIET openssl)
+ endif()
endif ()
# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES