Skip to content

Commit ab6b44b

Browse files
lingbinbradking
authored andcommitted
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.
1 parent 2cad910 commit ab6b44b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Modules/FindCURL.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ find_package(PkgConfig QUIET)
9494
if(PKG_CONFIG_FOUND)
9595
pkg_check_modules(PC_CURL QUIET libcurl)
9696
if(PC_CURL_FOUND)
97-
pkg_get_variable(CURL_SUPPORTED_PROTOCOLS libcurl supported_protocols)
98-
pkg_get_variable(CURL_SUPPORTED_FEATURES libcurl supported_features)
97+
pkg_get_variable(CURL_SUPPORTED_PROTOCOLS_STRING libcurl supported_protocols)
98+
string(REPLACE " " ";" CURL_SUPPORTED_PROTOCOLS "${CURL_SUPPORTED_PROTOCOLS_STRING}")
99+
pkg_get_variable(CURL_SUPPORTED_FEATURES_STRING libcurl supported_features)
100+
string(REPLACE " " ";" CURL_SUPPORTED_FEATURES "${CURL_SUPPORTED_FEATURES_STRING}")
99101
endif()
100102
endif()
101103

0 commit comments

Comments
 (0)