diff options
author | Alexander Lohnau <alexander.lohnau@gmx.de> | 2022-06-16 16:59:26 +0200 |
---|---|---|
committer | Alexander Lohnau <alexander.lohnau@gmx.de> | 2022-06-16 17:00:40 +0200 |
commit | 9aba268a7055fb7352a9d87c4e04abd48ba1b1b1 (patch) | |
tree | 9791dd38a5626b8bc797bed416559fce3dd6625d | |
parent | aa022e06ac7727560ffc2478352a79953787883e (diff) | |
download | extra-cmake-modules-9aba268a7055fb7352a9d87c4e04abd48ba1b1b1.tar.gz extra-cmake-modules-9aba268a7055fb7352a9d87c4e04abd48ba1b1b1.tar.bz2 |
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.
-rw-r--r-- | modules/ECMDeprecationSettings.cmake | 7 |
1 files changed, 1 insertions, 6 deletions
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}") |