1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-12-09 15:41:11 +03:00

cmake: verify minimum CMake version in libssh2-config.cmake

This is the same minimum version required to build libssh2 itself (3.7).

Closes #1754
This commit is contained in:
Viktor Szakats
2025-12-01 15:03:16 +01:00
parent 69bed46a9b
commit 96e21c2e25
2 changed files with 6 additions and 0 deletions

View File

@@ -4,6 +4,11 @@
option(LIBSSH2_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @LIBSSH2_USE_PKGCONFIG@"
"@LIBSSH2_USE_PKGCONFIG@")
if(CMAKE_VERSION VERSION_LESS @CMAKE_MINIMUM_REQUIRED_VERSION@)
message(STATUS "@PROJECT_NAME@: @PROJECT_NAME@-specific Find modules require "
"CMake @CMAKE_MINIMUM_REQUIRED_VERSION@ or upper, found: ${CMAKE_VERSION}.")
endif()
include(CMakeFindDependencyMacro)
set(_libssh2_cmake_module_path_save ${CMAKE_MODULE_PATH})

View File

@@ -397,6 +397,7 @@ if(NOT LIBSSH2_DISABLE_INSTALL)
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
# Consumed variables:
# CMAKE_MINIMUM_REQUIRED_VERSION
# CRYPTO_BACKEND
# LIB_NAME
# LIB_SELECTED