From 703a8113f42e794534df5dfc5cece5dabcb949d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Bornemann?= Date: Tue, 21 Feb 2023 19:58:03 +0100 Subject: [PATCH] [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. --- scripts/buildsystems/vcpkg.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 4ee6740a2a..1f6e16a5c2 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -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)