]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: show protocols, then features
authorViktor Szakats <commit@vsz.me>
Mon, 1 Jul 2024 22:11:29 +0000 (00:11 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 1 Jul 2024 23:03:09 +0000 (01:03 +0200)
To match the order used by `curl -V` and `./configure`.

Closes #14082

CMakeLists.txt

index 42b1a3415a90f6e5f59d8eb086333a1f84aa9be4..88f0d590b47781ddad1b4cf4392f1ade0b1993aa 100644 (file)
@@ -1661,6 +1661,51 @@ if(NOT CURL_DISABLE_INSTALL)
     set(use_curl_ntlm_core ON)
   endif()
 
+  # Clear list and try to detect available protocols
+  set(_items)
+  _add_if("HTTP"          NOT CURL_DISABLE_HTTP)
+  _add_if("IPFS"          NOT CURL_DISABLE_HTTP)
+  _add_if("IPNS"          NOT CURL_DISABLE_HTTP)
+  _add_if("HTTPS"         NOT CURL_DISABLE_HTTP AND SSL_ENABLED)
+  _add_if("ECH"           HAVE_ECH)
+  _add_if("HTTPSRR"       HAVE_ECH)
+  _add_if("FTP"           NOT CURL_DISABLE_FTP)
+  _add_if("FTPS"          NOT CURL_DISABLE_FTP AND SSL_ENABLED)
+  _add_if("FILE"          NOT CURL_DISABLE_FILE)
+  _add_if("TELNET"        NOT CURL_DISABLE_TELNET)
+  _add_if("LDAP"          NOT CURL_DISABLE_LDAP)
+  # CURL_DISABLE_LDAP implies CURL_DISABLE_LDAPS
+  _add_if("LDAPS"         NOT CURL_DISABLE_LDAPS AND
+                          ((USE_OPENLDAP AND SSL_ENABLED) OR
+                          (NOT USE_OPENLDAP AND HAVE_LDAP_SSL)))
+  _add_if("DICT"          NOT CURL_DISABLE_DICT)
+  _add_if("TFTP"          NOT CURL_DISABLE_TFTP)
+  _add_if("GOPHER"        NOT CURL_DISABLE_GOPHER)
+  _add_if("GOPHERS"       NOT CURL_DISABLE_GOPHER AND SSL_ENABLED)
+  _add_if("POP3"          NOT CURL_DISABLE_POP3)
+  _add_if("POP3S"         NOT CURL_DISABLE_POP3 AND SSL_ENABLED)
+  _add_if("IMAP"          NOT CURL_DISABLE_IMAP)
+  _add_if("IMAPS"         NOT CURL_DISABLE_IMAP AND SSL_ENABLED)
+  _add_if("SMB"           NOT CURL_DISABLE_SMB AND
+                          use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4))
+  _add_if("SMBS"          NOT CURL_DISABLE_SMB AND SSL_ENABLED AND
+                          use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4))
+  _add_if("SMTP"          NOT CURL_DISABLE_SMTP)
+  _add_if("SMTPS"         NOT CURL_DISABLE_SMTP AND SSL_ENABLED)
+  _add_if("SCP"           USE_LIBSSH2 OR USE_LIBSSH)
+  _add_if("SFTP"          USE_LIBSSH2 OR USE_LIBSSH)
+  _add_if("RTSP"          NOT CURL_DISABLE_RTSP)
+  _add_if("RTMP"          USE_LIBRTMP)
+  _add_if("MQTT"          NOT CURL_DISABLE_MQTT)
+  _add_if("WS"            USE_WEBSOCKETS)
+  _add_if("WSS"           USE_WEBSOCKETS AND SSL_ENABLED)
+  if(_items)
+    list(SORT _items)
+  endif()
+  string(REPLACE ";" " " SUPPORT_PROTOCOLS "${_items}")
+  string(TOLOWER "${SUPPORT_PROTOCOLS}" SUPPORT_PROTOCOLS_LOWER)
+  message(STATUS "Enabled protocols: ${SUPPORT_PROTOCOLS_LOWER}")
+
   # Clear list and try to detect available features
   set(_items)
   _add_if("SSL"           SSL_ENABLED)
@@ -1707,51 +1752,6 @@ if(NOT CURL_DISABLE_INSTALL)
   string(REPLACE ";" " " SUPPORT_FEATURES "${_items}")
   message(STATUS "Enabled features: ${SUPPORT_FEATURES}")
 
-  # Clear list and try to detect available protocols
-  set(_items)
-  _add_if("HTTP"          NOT CURL_DISABLE_HTTP)
-  _add_if("IPFS"          NOT CURL_DISABLE_HTTP)
-  _add_if("IPNS"          NOT CURL_DISABLE_HTTP)
-  _add_if("HTTPS"         NOT CURL_DISABLE_HTTP AND SSL_ENABLED)
-  _add_if("ECH"           HAVE_ECH)
-  _add_if("HTTPSRR"       HAVE_ECH)
-  _add_if("FTP"           NOT CURL_DISABLE_FTP)
-  _add_if("FTPS"          NOT CURL_DISABLE_FTP AND SSL_ENABLED)
-  _add_if("FILE"          NOT CURL_DISABLE_FILE)
-  _add_if("TELNET"        NOT CURL_DISABLE_TELNET)
-  _add_if("LDAP"          NOT CURL_DISABLE_LDAP)
-  # CURL_DISABLE_LDAP implies CURL_DISABLE_LDAPS
-  _add_if("LDAPS"         NOT CURL_DISABLE_LDAPS AND
-                          ((USE_OPENLDAP AND SSL_ENABLED) OR
-                          (NOT USE_OPENLDAP AND HAVE_LDAP_SSL)))
-  _add_if("DICT"          NOT CURL_DISABLE_DICT)
-  _add_if("TFTP"          NOT CURL_DISABLE_TFTP)
-  _add_if("GOPHER"        NOT CURL_DISABLE_GOPHER)
-  _add_if("GOPHERS"       NOT CURL_DISABLE_GOPHER AND SSL_ENABLED)
-  _add_if("POP3"          NOT CURL_DISABLE_POP3)
-  _add_if("POP3S"         NOT CURL_DISABLE_POP3 AND SSL_ENABLED)
-  _add_if("IMAP"          NOT CURL_DISABLE_IMAP)
-  _add_if("IMAPS"         NOT CURL_DISABLE_IMAP AND SSL_ENABLED)
-  _add_if("SMB"           NOT CURL_DISABLE_SMB AND
-                          use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4))
-  _add_if("SMBS"          NOT CURL_DISABLE_SMB AND SSL_ENABLED AND
-                          use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4))
-  _add_if("SMTP"          NOT CURL_DISABLE_SMTP)
-  _add_if("SMTPS"         NOT CURL_DISABLE_SMTP AND SSL_ENABLED)
-  _add_if("SCP"           USE_LIBSSH2 OR USE_LIBSSH)
-  _add_if("SFTP"          USE_LIBSSH2 OR USE_LIBSSH)
-  _add_if("RTSP"          NOT CURL_DISABLE_RTSP)
-  _add_if("RTMP"          USE_LIBRTMP)
-  _add_if("MQTT"          NOT CURL_DISABLE_MQTT)
-  _add_if("WS"            USE_WEBSOCKETS)
-  _add_if("WSS"           USE_WEBSOCKETS AND SSL_ENABLED)
-  if(_items)
-    list(SORT _items)
-  endif()
-  string(REPLACE ";" " " SUPPORT_PROTOCOLS "${_items}")
-  string(TOLOWER "${SUPPORT_PROTOCOLS}" SUPPORT_PROTOCOLS_LOWER)
-  message(STATUS "Enabled protocols: ${SUPPORT_PROTOCOLS_LOWER}")
-
   # Clear list and collect SSL backends
   set(_items)
   _add_if("Schannel"         SSL_ENABLED AND USE_SCHANNEL)