summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorlingbin <lingbinlb@gmail.com>2023-12-19 08:18:37 (GMT)
committerBrad King <brad.king@kitware.com>2023-12-19 14:36:09 (GMT)
commitab6b44b1bb88273a7944acf822560386f9a0a082 (patch)
tree52c5282ab6a825383dbce73ef914614ad73f33ee /Modules
parent2cad910ecb39cf19367b89a5489c634ae5ac3375 (diff)
downloadCMake-ab6b44b1bb88273a7944acf822560386f9a0a082.zip
CMake-ab6b44b1bb88273a7944acf822560386f9a0a082.tar.gz
CMake-ab6b44b1bb88273a7944acf822560386f9a0a082.tar.bz2
FindCURL: Fix parsing protocols/features from pkg-config output
Previously `find_package(CURL COMPONENTS HTTP)` failed because the `CURL_SUPPORTED_PROTOCOLS` variable returned by pkg-config is a command-line fragment, but we need a semicolon-separated list.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindCURL.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 2f33dac..5e5f1f8 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -94,8 +94,10 @@ find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_CURL QUIET libcurl)
if(PC_CURL_FOUND)
- pkg_get_variable(CURL_SUPPORTED_PROTOCOLS libcurl supported_protocols)
- pkg_get_variable(CURL_SUPPORTED_FEATURES libcurl supported_features)
+ pkg_get_variable(CURL_SUPPORTED_PROTOCOLS_STRING libcurl supported_protocols)
+ string(REPLACE " " ";" CURL_SUPPORTED_PROTOCOLS "${CURL_SUPPORTED_PROTOCOLS_STRING}")
+ pkg_get_variable(CURL_SUPPORTED_FEATURES_STRING libcurl supported_features)
+ string(REPLACE " " ";" CURL_SUPPORTED_FEATURES "${CURL_SUPPORTED_FEATURES_STRING}")
endif()
endif()