]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: sync up formatting in Find modules
authorViktor Szakats <commit@vsz.me>
Tue, 13 Aug 2024 08:45:37 +0000 (10:45 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 13 Aug 2024 23:44:16 +0000 (01:44 +0200)
- lowercase internal variable names (FindGSS)
- comments
- whitespace

Closes #14527

14 files changed:
CMake/FindBrotli.cmake
CMake/FindCARES.cmake
CMake/FindGSS.cmake
CMake/FindLibPSL.cmake
CMake/FindLibSSH2.cmake
CMake/FindMSH3.cmake
CMake/FindMbedTLS.cmake
CMake/FindNGHTTP2.cmake
CMake/FindNGHTTP3.cmake
CMake/FindNGTCP2.cmake
CMake/FindNettle.cmake
CMake/FindQUICHE.cmake
CMake/FindWolfSSL.cmake
CMake/FindZstd.cmake

index ae755fefba2ea5962e3bd2491a282dd9fa164ad0..74e309de8c1071a7bf411e0c5aefa205a396b786 100644 (file)
 # BROTLI_INCLUDE_DIRS  The brotli include directories
 # BROTLI_LIBRARIES     The brotli library names
 
-include(FindPackageHandleStandardArgs)
-
 find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
 
 find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
 find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
 
+include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Brotli
   FOUND_VAR
     BROTLI_FOUND
index 967fe020f268bcf7b6c66d686da271894d09ff7c..12efea9138a48c19493e861884397973094d67b8 100644 (file)
@@ -31,9 +31,7 @@
 
 find_path(CARES_INCLUDE_DIR "ares.h")
 
-find_library(CARES_LIBRARY
-  NAMES ${CARES_NAMES} "cares"
-)
+find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(CARES
index 83a9fc2d6f61a6e71450ee72a21fb8eaaa0fb8fb..40b92184d63ccc192d69d77327dd16c325db95d9 100644 (file)
@@ -31,8 +31,8 @@
 #
 # GSS_FOUND             System has the Heimdal library
 # GSS_FLAVOUR           "MIT" or "Heimdal" if anything found
-# GSS_INCLUDE_DIR       the Heimdal include directory
-# GSS_LIBRARIES         The libraries needed to use GSS
+# GSS_INCLUDE_DIR       The GSS include directory
+# GSS_LIBRARIES         The GSS library names
 # GSS_LINK_DIRECTORIES  Directories to add to linker search path
 # GSS_LINKER_FLAGS      Additional linker flags
 # GSS_COMPILER_FLAGS    Additional compiler flags
@@ -166,9 +166,7 @@ if(NOT _GSS_FOUND)  # Not found by pkg-config. Let us take more traditional appr
 
   else()  # Either there is no config script or we are on a platform that does not provide one (Windows?)
 
-    find_path(_GSS_INCLUDE_DIRS
-      NAMES
-        "gssapi/gssapi.h"
+    find_path(_GSS_INCLUDE_DIRS NAMES "gssapi/gssapi.h"
       HINTS
         ${_gss_root_hints}
       PATH_SUFFIXES
@@ -178,26 +176,24 @@ if(NOT _GSS_FOUND)  # Not found by pkg-config. Let us take more traditional appr
 
     if(_GSS_INCLUDE_DIRS)  # jay, we have found something
       set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIRS}")
-      check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _GSS_HAVE_MIT_HEADERS)
+      check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)
 
-      if(_GSS_HAVE_MIT_HEADERS)
+      if(_gss_have_mit_headers)
         set(GSS_FLAVOUR "MIT")
       else()
         # Prevent compiling the header - just check if we can include it
         list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
-        check_include_file("roken.h" _GSS_HAVE_ROKEN_H)
+        check_include_file("roken.h" _gss_have_roken_h)
 
-        check_include_file("heimdal/roken.h" _GSS_HAVE_HEIMDAL_ROKEN_H)
-        if(_GSS_HAVE_ROKEN_H OR _GSS_HAVE_HEIMDAL_ROKEN_H)
+        check_include_file("heimdal/roken.h" _gss_have_heimdal_roken_h)
+        if(_gss_have_roken_h OR _gss_have_heimdal_roken_h)
           set(GSS_FLAVOUR "Heimdal")
         endif()
         list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
       endif()
     else()
       # I am not convinced if this is the right way but this is what autotools do at the moment
-      find_path(_GSS_INCLUDE_DIRS
-        NAMES
-          "gssapi.h"
+      find_path(_GSS_INCLUDE_DIRS NAMES "gssapi.h"
         HINTS
           ${_gss_root_hints}
         PATH_SUFFIXES
@@ -242,9 +238,7 @@ if(NOT _GSS_FOUND)  # Not found by pkg-config. Let us take more traditional appr
         endif()
       endif()
 
-      find_library(_GSS_LIBRARIES
-        NAMES
-          ${_gss_libname}
+      find_library(_GSS_LIBRARIES NAMES ${_gss_libname}
         HINTS
           ${_gss_libdir_hints}
         PATH_SUFFIXES
@@ -302,7 +296,6 @@ if(GSS_FLAVOUR)
 endif()
 
 include(FindPackageHandleStandardArgs)
-
 find_package_handle_standard_args(GSS
   REQUIRED_VARS
     GSS_LIBRARIES GSS_FLAVOUR
index 56bda08fff4719813713460222fab675a1eb9b74..04331d2444ee5c08e70984415dfbc9d263726d7d 100644 (file)
@@ -36,7 +36,7 @@ find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl")
 
 if(LIBPSL_INCLUDE_DIR)
   file(STRINGS "${LIBPSL_INCLUDE_DIR}/libpsl.h" _libpsl_version_str REGEX "^#define[\t ]+PSL_VERSION[\t ]+\"(.*)\"")
-  string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1"  LIBPSL_VERSION "${_libpsl_version_str}")
+  string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBPSL_VERSION "${_libpsl_version_str}")
 endif()
 
 include(FindPackageHandleStandardArgs)
index 2aab5f302bdb6bfa591fc6b3aedaf98fe7460f72..3103b3982001229a8079957583bbb4bc7214751a 100644 (file)
@@ -36,7 +36,7 @@ find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
 
 if(LIBSSH2_INCLUDE_DIR)
   file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" _libssh2_version_str REGEX "^#define[\t ]+LIBSSH2_VERSION[\t ]+\"(.*)\"")
-  string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1"  LIBSSH2_VERSION "${_libssh2_version_str}")
+  string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBSSH2_VERSION "${_libssh2_version_str}")
 endif()
 
 include(FindPackageHandleStandardArgs)
index 56dc2a39effdad91dff4a8b4185e952e3fa39ccb..cb122c3b6e5dfffe44bc45f51431ea805848e480 100644 (file)
@@ -27,7 +27,7 @@
 #
 # MSH3_FOUND         System has msh3
 # MSH3_INCLUDE_DIRS  The msh3 include directories
-# MSH3_LIBRARIES     The libraries needed to use msh3
+# MSH3_LIBRARIES     The msh3 library names
 
 if(CURL_USE_PKGCONFIG)
   find_package(PkgConfig QUIET)
index 8cfe70a683640a5be8fc26be91438812cc254dfe..fc79dcf0f357afebe7749ff5ac415279b1c8a8c2 100644 (file)
@@ -27,7 +27,7 @@
 #
 # MBEDTLS_FOUND         System has mbedtls
 # MBEDTLS_INCLUDE_DIRS  The mbedtls include directories
-# MBEDTLS_LIBRARIES     The libraries needed to use mbedtls
+# MBEDTLS_LIBRARIES     The mbedtls library names
 
 find_path(MBEDTLS_INCLUDE_DIRS "mbedtls/ssl.h")
 
index c60cda75988733959a68497a355ddb29659d9959..4e17d0f70acc8342bf25978e3cb0b982e4fd1ff0 100644 (file)
@@ -27,7 +27,7 @@
 #
 # NGHTTP2_FOUND         System has nghttp2
 # NGHTTP2_INCLUDE_DIRS  The nghttp2 include directories
-# NGHTTP2_LIBRARIES     The libraries needed to use nghttp2
+# NGHTTP2_LIBRARIES     The nghttp2 library names
 # NGHTTP2_VERSION       Version of nghttp2
 
 if(CURL_USE_PKGCONFIG)
index ee1708e0c78d4fd3067b9f01ce70b33b86822f25..0094b6a1871bc572dfe4c27c3966a532edc6b25e 100644 (file)
@@ -27,7 +27,7 @@
 #
 # NGHTTP3_FOUND         System has nghttp3
 # NGHTTP3_INCLUDE_DIRS  The nghttp3 include directories
-# NGHTTP3_LIBRARIES     The libraries needed to use nghttp3
+# NGHTTP3_LIBRARIES     The nghttp3 library names
 # NGHTTP3_VERSION       Version of nghttp3
 
 if(CURL_USE_PKGCONFIG)
index 228713d578c5153f5d199d0108cec42cbe0ca6d7..39523cb133248ef77a7ee8e8ff76bb644c2cb2e2 100644 (file)
@@ -35,7 +35,7 @@
 #
 # NGTCP2_FOUND         System has ngtcp2
 # NGTCP2_INCLUDE_DIRS  The ngtcp2 include directories
-# NGTCP2_LIBRARIES     The libraries needed to use ngtcp2
+# NGTCP2_LIBRARIES     The ngtcp2 library names
 # NGTCP2_VERSION       Version of ngtcp2
 
 if(CURL_USE_PKGCONFIG)
@@ -75,9 +75,7 @@ if(NGTCP2_FIND_COMPONENTS)
     if(CURL_USE_PKGCONFIG)
       pkg_search_module(PC_${_crypto_library} "lib${_crypto_library}")
     endif()
-    find_library(${_crypto_library}_LIBRARY
-      NAMES
-        ${_crypto_library}
+    find_library(${_crypto_library}_LIBRARY NAMES ${_crypto_library}
       HINTS
         ${PC_${_crypto_library}_LIBDIR}
         ${PC_${_crypto_library}_LIBRARY_DIRS}
index a61c61d9dfdd607dc2f0e7c5495b5f237545d152..b3073367d26145516705017241838499f9101e68 100644 (file)
@@ -45,10 +45,8 @@ else()
     if(EXISTS "${NETTLE_INCLUDE_DIR}/nettle/version.h")
       set(_version_regex_major "^#define[ \t]+NETTLE_VERSION_MAJOR[ \t]+([0-9]+).*")
       set(_version_regex_minor "^#define[ \t]+NETTLE_VERSION_MINOR[ \t]+([0-9]+).*")
-      file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h"
-        _version_major REGEX "${_version_regex_major}")
-      file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h"
-        _version_minor REGEX "${_version_regex_minor}")
+      file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_major REGEX "${_version_regex_major}")
+      file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_minor REGEX "${_version_regex_minor}")
       string(REGEX REPLACE "${_version_regex_major}" "\\1" _version_major "${_version_major}")
       string(REGEX REPLACE "${_version_regex_minor}" "\\1" _version_minor "${_version_minor}")
       unset(_version_regex_major)
index e7ebb2b992713a26e691079ec0fc3c87b4ef0c27..dd135ce3d6fc93fc64276a9283b677ee5eca91d5 100644 (file)
@@ -27,7 +27,7 @@
 #
 # QUICHE_FOUND         System has quiche
 # QUICHE_INCLUDE_DIRS  The quiche include directories
-# QUICHE_LIBRARIES     The libraries needed to use quiche
+# QUICHE_LIBRARIES     The quiche library names
 
 if(CURL_USE_PKGCONFIG)
   find_package(PkgConfig QUIET)
index 0c9d9de4f2ac8f3903332aa36ad98ff437f4d63b..402b4970a8398252197fcba94f26abefe2cfdd18 100644 (file)
@@ -35,22 +35,20 @@ if(CURL_USE_PKGCONFIG)
   pkg_search_module(PC_WOLFSSL QUIET "wolfssl")
 endif()
 
-find_path(WolfSSL_INCLUDE_DIR
-  NAMES "wolfssl/ssl.h"
-  HINTS ${PC_WOLFSSL_INCLUDE_DIRS}
+find_path(WolfSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h"
+  HINTS
+    ${PC_WOLFSSL_INCLUDE_DIRS}
 )
 
-find_library(WolfSSL_LIBRARY
-  NAMES "wolfssl"
-  HINTS ${PC_WOLFSSL_LIBRARY_DIRS}
+find_library(WolfSSL_LIBRARY NAMES "wolfssl"
+  HINTS
+    ${PC_WOLFSSL_LIBRARY_DIRS}
 )
 
 if(WolfSSL_INCLUDE_DIR)
   set(_version_regex "^#define[ \t]+LIBWOLFSSL_VERSION_STRING[ \t]+\"([^\"]+)\".*")
-  file(STRINGS "${WolfSSL_INCLUDE_DIR}/wolfssl/version.h"
-    WolfSSL_VERSION REGEX "${_version_regex}")
-  string(REGEX REPLACE "${_version_regex}" "\\1"
-    WolfSSL_VERSION "${WolfSSL_VERSION}")
+  file(STRINGS "${WolfSSL_INCLUDE_DIR}/wolfssl/version.h" WolfSSL_VERSION REGEX "${_version_regex}")
+  string(REGEX REPLACE "${_version_regex}" "\\1" WolfSSL_VERSION "${WolfSSL_VERSION}")
   unset(_version_regex)
 endif()
 
index 1d5c271c8a89a5138ae983d2e786d368d17675f8..b9248fd1c429b192bd7ece9480e9ac60c0bb6928 100644 (file)
@@ -27,7 +27,7 @@
 #
 # Zstd_FOUND         System has zstd
 # Zstd_INCLUDE_DIRS  The zstd include directories
-# Zstd_LIBRARIES     The libraries needed to use zstd
+# Zstd_LIBRARIES     The zstd library names
 # Zstd_VERSION       Version of zstd
 
 if(CURL_USE_PKGCONFIG)