[vcpkg.cmake] Make use of CMake 3.7 language features (#29721)

vcpkg.cmake requires at least CMake 3.7.2. We can remove the
work-arounds for older CMake versions that lack GREATER_EQUAL and
VERSION_GREATER_EQUAL.
This commit is contained in:
Jörg Bornemann 2023-02-21 19:58:03 +01:00 коммит произвёл GitHub
Родитель 3768a4d37e
Коммит 703a8113f4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -164,8 +164,7 @@ macro(z_vcpkg_function_arguments OUT_VAR)
set(z_vcpkg_function_arguments_ARGC "${${z_vcpkg_function_arguments_ARGC_NAME}}")
math(EXPR z_vcpkg_function_arguments_LAST_ARG "${z_vcpkg_function_arguments_ARGC} - 1")
# GREATER_EQUAL added in CMake 3.7
if(NOT z_vcpkg_function_arguments_LAST_ARG LESS z_vcpkg_function_arguments_FIRST_ARG)
if(z_vcpkg_function_arguments_LAST_ARG GREATER_EQUAL z_vcpkg_function_arguments_FIRST_ARG)
foreach(z_vcpkg_function_arguments_N RANGE "${z_vcpkg_function_arguments_FIRST_ARG}" "${z_vcpkg_function_arguments_LAST_ARG}")
string(REPLACE ";" "\\;" z_vcpkg_function_arguments_ESCAPED_ARG "${ARGV${z_vcpkg_function_arguments_N}}")
# adds an extra `;` on the first time through
@ -497,7 +496,7 @@ if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT Z_VCPKG_CMAKE_IN_TRY_C
list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--x-no-default-features")
endif()
if(NOT CMAKE_VERSION VERSION_LESS "3.18") # == GREATER_EQUAL, but that was added in CMake 3.7
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
set(Z_VCPKG_MANIFEST_INSTALL_ECHO_PARAMS ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE)
else()
set(Z_VCPKG_MANIFEST_INSTALL_ECHO_PARAMS)