From 9aba268a7055fb7352a9d87c4e04abd48ba1b1b1 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Thu, 16 Jun 2022 16:59:26 +0200 Subject: Fix SHOW_DEPRECATIONS option not getting respected when function is called This got messed up when refactoring the value from an one-value-keyword to an option. --- modules/ECMDeprecationSettings.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'modules/ECMDeprecationSettings.cmake') diff --git a/modules/ECMDeprecationSettings.cmake b/modules/ECMDeprecationSettings.cmake index f41180e6..f46eaa37 100644 --- a/modules/ECMDeprecationSettings.cmake +++ b/modules/ECMDeprecationSettings.cmake @@ -50,11 +50,6 @@ Since 5.91 function (ecm_set_disabled_deprecation_versions) include(CMakeParseArguments) cmake_parse_arguments(ARGS "SHOW_DEPRECATIONS" "" "" ${ARGN}) - if (ARGS_DEPRECATION_WARNINGS) - if (NOT "${ARGS_DEPRECATION_WARNINGS}" MATCHES "CURRENT_VERSION|MAJOR_VERSION") - message(FATAL_ERROR "Unknown argument given for DEPRECATION_WARNINGS parameter, expected CURRENT_VERSION or MAJOR_VERSION") - endif() - endif() list(LENGTH ARGS_UNPARSED_ARGUMENTS PAIR_COUNT) math(EXPR is_even_number "${PAIR_COUNT} % 2") if (NOT is_even_number EQUAL 0) @@ -88,7 +83,7 @@ function (ecm_set_disabled_deprecation_versions) add_definitions(-D${DEPRECATION_DEFINITION_NAME}=${DEPRECATION_HEX_VERSION}) # Set the version for the deprecation warnings - if (ARGS_DEPRECATION_WARNINGS) + if (ARGS_SHOW_DEPRECATIONS) string(REGEX MATCH "([0-9]+)\\." _ ${DEPRECATION_VERSION}) if (NOT CMAKE_MATCH_1) message(FATAL_ERROR "Failed to get major version from ${DEPRECATION_VERSION}") -- cgit v1.2.1