mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 04:09:01 +00:00
Update libssh2 to 1.11.1
This commit is contained in:
@@ -1,53 +1,59 @@
|
||||
# Copyright (c) 2014 Alexander Lamaison <alexander.lamaison@gmail.com>
|
||||
# Copyright (C) The libssh2 project and its contributors.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
# Redistribution and use in source and binary forms,
|
||||
# with or without modification, are permitted provided
|
||||
# that the following conditions are met:
|
||||
###########################################################################
|
||||
# Find the libgcrypt library
|
||||
#
|
||||
# Redistributions of source code must retain the above
|
||||
# copyright notice, this list of conditions and the
|
||||
# following disclaimer.
|
||||
# Input variables:
|
||||
#
|
||||
# Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
# LIBGCRYPT_INCLUDE_DIR The libgcrypt include directory
|
||||
# LIBGCRYPT_LIBRARY Path to libgcrypt library
|
||||
#
|
||||
# Neither the name of the copyright holder nor the names
|
||||
# of any other contributors may be used to endorse or
|
||||
# promote products derived from this software without
|
||||
# specific prior written permission.
|
||||
# Result variables:
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
# OF SUCH DAMAGE.
|
||||
# LIBGCRYPT_FOUND System has libgcrypt
|
||||
# LIBGCRYPT_INCLUDE_DIRS The libgcrypt include directories
|
||||
# LIBGCRYPT_LIBRARIES The libgcrypt library names
|
||||
# LIBGCRYPT_LIBRARY_DIRS The libgcrypt library directories
|
||||
# LIBGCRYPT_CFLAGS Required compiler flags
|
||||
# LIBGCRYPT_VERSION Version of libgcrypt
|
||||
|
||||
# - Try to find Libgcrypt
|
||||
# This will define all or none of:
|
||||
# LIBGCRYPT_FOUND - if Libgcrypt headers and library was found
|
||||
# LIBGCRYPT_INCLUDE_DIRS - The Libgcrypt include directories
|
||||
# LIBGCRYPT_LIBRARIES - The libraries needed to use Libgcrypt
|
||||
if((UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING)) AND
|
||||
NOT DEFINED LIBGCRYPT_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBGCRYPT_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBGCRYPT "libgcrypt")
|
||||
endif()
|
||||
|
||||
find_path(LIBGCRYPT_INCLUDE_DIR gcrypt.h)
|
||||
if(LIBGCRYPT_FOUND)
|
||||
string(REPLACE ";" " " LIBGCRYPT_CFLAGS "${LIBGCRYPT_CFLAGS}")
|
||||
message(STATUS "Found Libgcrypt (via pkg-config): ${LIBGCRYPT_INCLUDE_DIRS} (found version \"${LIBGCRYPT_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBGCRYPT_INCLUDE_DIR NAMES "gcrypt.h")
|
||||
find_library(LIBGCRYPT_LIBRARY NAMES "gcrypt" "libgcrypt")
|
||||
|
||||
find_library(LIBGCRYPT_LIBRARY NAMES gcrypt libgcrypt)
|
||||
if(LIBGCRYPT_INCLUDE_DIR AND EXISTS "${LIBGCRYPT_INCLUDE_DIR}/gcrypt.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+GCRYPT_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${LIBGCRYPT_INCLUDE_DIR}/gcrypt.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(LIBGCRYPT_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
set(LIBGCRYPT_LIBRARIES ${LIBGCRYPT_LIBRARY})
|
||||
set(LIBGCRYPT_INCLUDE_DIRS ${LIBGCRYPT_INCLUDE_DIR})
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libgcrypt
|
||||
REQUIRED_VARS
|
||||
LIBGCRYPT_INCLUDE_DIR
|
||||
LIBGCRYPT_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBGCRYPT_VERSION
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libgcrypt DEFAULT_MSG
|
||||
LIBGCRYPT_LIBRARY LIBGCRYPT_INCLUDE_DIR)
|
||||
if(LIBGCRYPT_FOUND)
|
||||
set(LIBGCRYPT_INCLUDE_DIRS ${LIBGCRYPT_INCLUDE_DIR})
|
||||
set(LIBGCRYPT_LIBRARIES ${LIBGCRYPT_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBGCRYPT_INCLUDE_DIR LIBGCRYPT_LIBRARY)
|
||||
mark_as_advanced(LIBGCRYPT_INCLUDE_DIR LIBGCRYPT_LIBRARY)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user