From 90d814f02496f80403b33c4ef43e18be203b2f24 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 9 Dec 2024 18:50:54 -0500 Subject: [PATCH] CMP0054: Remove support for OLD behavior --- Help/command/if.rst | 6 +- Help/policy/CMP0054.rst | 9 +-- Modules/CMakeIOSInstallCombined.cmake | 1 - Modules/CMakeParseImplicitLinkInfo.cmake | 5 -- Modules/CMakeParseLibraryArchitecture.cmake | 5 -- Modules/CheckSymbolExists.cmake | 5 -- Modules/CheckTypeSize.cmake | 1 - Modules/ExternalProject.cmake | 1 - Modules/FindDoxygen.cmake | 1 - Modules/FindOpenMP.cmake | 1 - Modules/FindPkgConfig.cmake | 1 - Modules/GNUInstallDirs.cmake | 5 -- Modules/InstallRequiredSystemLibraries.cmake | 5 -- Modules/Internal/CMakeDetermineLinkerId.cmake | 5 -- Modules/Internal/CheckFlagCommonConfig.cmake | 6 -- Modules/Internal/CheckLinkerFlag.cmake | 5 -- Modules/Internal/CheckSourceCompiles.cmake | 1 - Modules/Internal/CheckSourceRuns.cmake | 1 - Modules/Internal/HeaderpadWorkaround.cmake | 5 -- Modules/Linker/GNU.cmake | 1 - Modules/Linker/LLD.cmake | 6 -- Modules/Linker/MOLD.cmake | 5 -- .../Linker/BSD-Linker-Initialize.cmake | 5 -- Modules/Platform/Linker/FreeBSD-ASM.cmake | 6 -- Modules/Platform/Linker/FreeBSD-C.cmake | 5 -- Modules/Platform/Linker/FreeBSD-CXX.cmake | 5 -- Modules/Platform/Linker/FreeBSD-Fortran.cmake | 5 -- Modules/Platform/Linker/GNU.cmake | 5 -- Modules/Platform/Linker/OpenBSD-ASM.cmake | 5 -- Modules/Platform/Linker/OpenBSD-C.cmake | 5 -- Modules/Platform/Linker/OpenBSD-CXX.cmake | 5 -- Modules/Platform/Linker/OpenBSD-Fortran.cmake | 5 -- Modules/Platform/Linker/SunOS-Solaris.cmake | 5 -- Modules/Platform/Linker/Windows-ASM.cmake | 5 -- Modules/Platform/Linker/Windows-C.cmake | 5 -- Modules/Platform/Linker/Windows-CXX.cmake | 5 -- Modules/Platform/Linker/Windows-Fortran.cmake | 5 -- Modules/Platform/Linker/Windows-HIP.cmake | 5 -- Modules/Platform/Linker/Windows-LLD.cmake | 5 -- Modules/Platform/Linker/Windows-MSVC.cmake | 5 -- .../Platform/Linker/WindowsPhone-ASM.cmake | 5 -- Modules/Platform/Linker/WindowsPhone-C.cmake | 5 -- .../Platform/Linker/WindowsPhone-CXX.cmake | 5 -- .../Platform/Linker/WindowsStore-ASM.cmake | 5 -- Modules/Platform/Linker/WindowsStore-C.cmake | 5 -- .../Platform/Linker/WindowsStore-CXX.cmake | 5 -- Source/cmConditionEvaluator.cxx | 53 ++------------- Source/cmConditionEvaluator.h | 2 - Source/cmMakefile.cxx | 6 -- Source/cmMakefile.h | 8 --- Source/cmPolicies.h | 2 +- Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt | 1 - Tests/RunCMake/CMP0054/CMP0054-NEW.cmake | 2 - Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt | 10 --- Tests/RunCMake/CMP0054/CMP0054-OLD.cmake | 47 -------------- .../RunCMake/CMP0054/CMP0054-WARN-stderr.txt | 23 ------- Tests/RunCMake/CMP0054/CMP0054-WARN.cmake | 7 -- .../CMP0054-duplicate-warnings-stderr.txt | 24 ------- .../CMP0054/CMP0054-duplicate-warnings.cmake | 12 ---- .../CMP0054/CMP0054-keywords-NEW-stderr.txt | 2 +- .../CMP0054/CMP0054-keywords-NEW.cmake | 2 - .../CMP0054/CMP0054-keywords-OLD-stderr.txt | 10 --- .../CMP0054/CMP0054-keywords-OLD.cmake | 9 --- .../CMP0054/CMP0054-keywords-WARN-stderr.txt | 25 ------- .../CMP0054/CMP0054-keywords-WARN.cmake | 5 -- .../CMP0054-policy-command-scope-stderr.txt | 10 --- .../CMP0054-policy-command-scope.cmake | 53 --------------- .../CMP0054-policy-foreach-scope-stderr.txt | 54 --------------- .../CMP0054-policy-foreach-scope.cmake | 49 -------------- .../CMP0054-policy-nested-if-stderr.txt | 10 --- .../CMP0054/CMP0054-policy-nested-if.cmake | 41 ------------ .../CMP0054-policy-while-scope-stderr.txt | 54 --------------- .../CMP0054/CMP0054-policy-while-scope.cmake | 65 ------------------- Tests/RunCMake/CMP0054/CMakeLists.txt | 2 +- Tests/RunCMake/CMP0054/RunCMakeTest.cmake | 10 --- Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 1 - Tests/RunCMake/list/POP_BACK.cmake | 2 - Tests/RunCMake/list/POP_FRONT.cmake | 2 - .../RunCMakeTest.cmake | 2 - .../RunCMakeTest.cmake | 2 - 80 files changed, 15 insertions(+), 794 deletions(-) delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-OLD.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-WARN.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-keywords-OLD.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-command-scope.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-nested-if.cmake delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt delete mode 100644 Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake diff --git a/Help/command/if.rst b/Help/command/if.rst index f0846f61eb..b2f7e6e6d0 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -87,9 +87,9 @@ Basic Expressions A quoted string always evaluates to false unless: * The string's value is one of the true constants, or - * Policy :policy:`CMP0054` is not set to ``NEW`` and the string's value - happens to be a variable name that is affected by :policy:`CMP0054`'s - behavior. + * in CMake versions prior to 4.0, policy :policy:`CMP0054` is not set + to ``NEW`` and the string's value happens to be a variable name that + is affected by :policy:`CMP0054`'s behavior. Logic Operators """"""""""""""" diff --git a/Help/policy/CMP0054.rst b/Help/policy/CMP0054.rst index d22e8d9b4e..f6a5c4d2b4 100644 --- a/Help/policy/CMP0054.rst +++ b/Help/policy/CMP0054.rst @@ -1,6 +1,9 @@ CMP0054 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + .. versionadded:: 3.1 Only interpret :command:`if` arguments as variables or keywords when unquoted. @@ -47,7 +50,5 @@ further dereferenced: if("E" STREQUAL "") .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1 -.. |WARNS_OR_DOES_NOT_WARN| replace:: warns -.. include:: STANDARD_ADVICE.txt - -.. include:: DEPRECATED.txt +.. |WARNED_OR_DID_NOT_WARN| replace:: warned +.. include:: REMOVED_EPILOGUE.txt diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake index 8d21155757..fbbe65fcd3 100644 --- a/Modules/CMakeIOSInstallCombined.cmake +++ b/Modules/CMakeIOSInstallCombined.cmake @@ -3,7 +3,6 @@ cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST -cmake_policy(SET CMP0054 NEW) # Function to print messages of this module function(_ios_install_combined_message) diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index e470a99f3f..1b4a01f5b9 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) - # Function to parse implicit linker options. # # This is used internally by CMake and should not be included by user @@ -400,5 +397,3 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex) set(${EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS} "${implicit_objs}" PARENT_SCOPE) endif() endfunction() - -cmake_policy(POP) diff --git a/Modules/CMakeParseLibraryArchitecture.cmake b/Modules/CMakeParseLibraryArchitecture.cmake index 37990e12b7..41ae2fb9a9 100644 --- a/Modules/CMakeParseLibraryArchitecture.cmake +++ b/Modules/CMakeParseLibraryArchitecture.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) - # Function parse implicit linker options. # This is used internally by CMake and should not be included by user # code. @@ -49,5 +46,3 @@ function(cmake_parse_library_architecture lang implicit_dirs implicit_objs outpu set(${output_var} "${library_arch}" PARENT_SCOPE) endif() endfunction() - -cmake_policy(POP) diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index a4950df725..7b62d6e0c9 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -59,9 +59,6 @@ For example: include_guard(GLOBAL) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced - macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) if(CMAKE_C_COMPILER_LOADED) __CHECK_SYMBOL_EXISTS_FILTER_FLAGS(C) @@ -185,5 +182,3 @@ int main(int argc, char** argv) unset(_CSE_SOURCE) endif() endmacro() - -endblock() diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index c2e131c0c6..cd4bc500db 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -150,7 +150,6 @@ get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) include_guard(GLOBAL) block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ #----------------------------------------------------------------------------- diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index f19934eddc..37d22d2f18 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1301,7 +1301,6 @@ The custom step could then be triggered from the main build like so:: include(${CMAKE_CURRENT_LIST_DIR}/ExternalProject/shared_internal_commands.cmake) cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST define_property(DIRECTORY PROPERTY "EP_BASE" INHERITED) diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index 737faf402c..5d8ac2ae4d 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -401,7 +401,6 @@ Deprecated Hint Variables #]=======================================================================] cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # quoted if arguments cmake_policy(SET CMP0057 NEW) # if IN_LIST # For backwards compatibility support diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 3c6149fd67..7664a707ef 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -111,7 +111,6 @@ to know what include directories are needed. #]=======================================================================] cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 372cab595d..e525b3626c 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -34,7 +34,6 @@ for how these variables are initialized. #]========================================] cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced cmake_policy(SET CMP0057 NEW) # if IN_LIST ### Common stuff #### diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index ed34c4a919..274cf24597 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -151,9 +151,6 @@ Macros this value through the variable ``${dir}``. #]=======================================================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced - # Convert a cache variable to PATH type macro(_GNUInstallDirs_cache_convert_to_path var description) @@ -452,5 +449,3 @@ foreach(dir ) GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_${dir} CMAKE_INSTALL_${dir} ${dir}) endforeach() - -cmake_policy(POP) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index d5e5fd218d..e3e17945d1 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -65,9 +65,6 @@ may be set prior to including the module to adjust behavior: Support for installing Intel compiler runtimes. #]=======================================================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced - set(_IRSL_HAVE_Intel FALSE) set(_IRSL_HAVE_MSVC FALSE) foreach(LANG IN ITEMS C CXX Fortran) @@ -806,5 +803,3 @@ if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) ) endif() endif() - -cmake_policy(POP) diff --git a/Modules/Internal/CMakeDetermineLinkerId.cmake b/Modules/Internal/CMakeDetermineLinkerId.cmake index d52d5940bf..35394281c3 100644 --- a/Modules/Internal/CMakeDetermineLinkerId.cmake +++ b/Modules/Internal/CMakeDetermineLinkerId.cmake @@ -6,9 +6,6 @@ # If successful, sets CMAKE__COMPILER_LINKER_ID and # CMAKE__COMPILER_LINKER_VERSION -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) - function(cmake_determine_linker_id lang linker) if (NOT linker) # linker was not identified @@ -102,5 +99,3 @@ function(cmake_determine_linker_id lang linker) unset(CMAKE_${lang}_COMPILER_LINKER_VERSION PARENT_SCOPE) endif() endfunction() - -cmake_policy(POP) diff --git a/Modules/Internal/CheckFlagCommonConfig.cmake b/Modules/Internal/CheckFlagCommonConfig.cmake index 557e9c7464..1bb534d2c6 100644 --- a/Modules/Internal/CheckFlagCommonConfig.cmake +++ b/Modules/Internal/CheckFlagCommonConfig.cmake @@ -8,10 +8,6 @@ include_guard(GLOBAL) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced -cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST - macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS) if("${_LANG}" STREQUAL "C") set(${_SRC} "int main(void) { return 0; }") @@ -75,5 +71,3 @@ macro(CMAKE_CHECK_FLAG_COMMON_FINISH) set(ENV{${v}} ${_CMAKE_CHECK_FLAG_COMMON_CONFIG_locale_vars_saved_${v}}) endforeach() endmacro() - -endblock() diff --git a/Modules/Internal/CheckLinkerFlag.cmake b/Modules/Internal/CheckLinkerFlag.cmake index b872b5121e..afd53dcf3e 100644 --- a/Modules/Internal/CheckLinkerFlag.cmake +++ b/Modules/Internal/CheckLinkerFlag.cmake @@ -6,9 +6,6 @@ include(Internal/CheckFlagCommonConfig) include(Internal/CheckSourceCompiles) include(CMakeCheckCompilerFlagCommonPatterns) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced - function(CMAKE_CHECK_LINKER_FLAG _lang _flag _var) # link step supports less languages than the compiler # so do a first check about the requested language @@ -48,5 +45,3 @@ function(CMAKE_CHECK_LINKER_FLAG _lang _flag _var) cmake_check_flag_common_finish() endfunction() - -endblock() diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake index 1eadc80576..e1dcfb71c6 100644 --- a/Modules/Internal/CheckSourceCompiles.cmake +++ b/Modules/Internal/CheckSourceCompiles.cmake @@ -4,7 +4,6 @@ include_guard(GLOBAL) block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var) diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake index 761598f326..d73db5c6fa 100644 --- a/Modules/Internal/CheckSourceRuns.cmake +++ b/Modules/Internal/CheckSourceRuns.cmake @@ -4,7 +4,6 @@ include_guard(GLOBAL) block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) diff --git a/Modules/Internal/HeaderpadWorkaround.cmake b/Modules/Internal/HeaderpadWorkaround.cmake index fccfaae4a6..6a13e6941c 100644 --- a/Modules/Internal/HeaderpadWorkaround.cmake +++ b/Modules/Internal/HeaderpadWorkaround.cmake @@ -9,9 +9,6 @@ if(NOT APPLE) return() endif() -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced - function(__cmake_internal_workaround_headerpad_flag_conflict _LANG) # Until we can avoid hard-coding -Wl,-headerpad_max_install_names in the @@ -65,5 +62,3 @@ foreach(__lang IN LISTS __enabled_languages) endforeach() unset(__lang) unset(__enabled_languages) - -endblock() diff --git a/Modules/Linker/GNU.cmake b/Modules/Linker/GNU.cmake index 30d6fb0d68..ba1d030079 100644 --- a/Modules/Linker/GNU.cmake +++ b/Modules/Linker/GNU.cmake @@ -6,7 +6,6 @@ include_guard() block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0140 NEW) function(__linker_gnu lang) diff --git a/Modules/Linker/LLD.cmake b/Modules/Linker/LLD.cmake index 1f184d5382..4d967300fe 100644 --- a/Modules/Linker/LLD.cmake +++ b/Modules/Linker/LLD.cmake @@ -3,10 +3,6 @@ include_guard() - -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - macro(__linker_lld lang) if(CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT STREQUAL "MSVC") include(Linker/MSVC) @@ -18,5 +14,3 @@ macro(__linker_lld lang) __linker_gnu(${lang}) endif() endmacro() - -endblock() diff --git a/Modules/Linker/MOLD.cmake b/Modules/Linker/MOLD.cmake index 6ad12fd689..0a9c65bfbc 100644 --- a/Modules/Linker/MOLD.cmake +++ b/Modules/Linker/MOLD.cmake @@ -5,9 +5,6 @@ # This module is shared by multiple linkers; use include blocker. include_guard() -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - macro(__linker_mold lang) if(CMAKE_EFFECTIVE_SYSTEM_NAME STREQUAL "Apple") include(Linker/AppleClang) @@ -19,5 +16,3 @@ macro(__linker_mold lang) __linker_gnu(${lang}) endif() endmacro() - -endblock() diff --git a/Modules/Platform/Linker/BSD-Linker-Initialize.cmake b/Modules/Platform/Linker/BSD-Linker-Initialize.cmake index 3de1dabb66..31157af4af 100644 --- a/Modules/Platform/Linker/BSD-Linker-Initialize.cmake +++ b/Modules/Platform/Linker/BSD-Linker-Initialize.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(NOT _CMAKE_SYSTEM_LINKER_TYPE) block(SCOPE_FOR VARIABLES) execute_process(COMMAND "${CMAKE_LINKER}" --version @@ -18,5 +15,3 @@ if(NOT _CMAKE_SYSTEM_LINKER_TYPE) endif() endblock() endif() - -endblock() diff --git a/Modules/Platform/Linker/FreeBSD-ASM.cmake b/Modules/Platform/Linker/FreeBSD-ASM.cmake index d8c8c863d5..d2465cf208 100644 --- a/Modules/Platform/Linker/FreeBSD-ASM.cmake +++ b/Modules/Platform/Linker/FreeBSD-ASM.cmake @@ -2,14 +2,8 @@ # file Copyright.txt or https://cmake.org/licensing for details. include(Platform/Linker/BSD-Linker-Initialize) - -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/FreeBSD-GNU-ASM) else() include(Platform/Linker/FreeBSD-LLD-ASM) endif() - -endblock() diff --git a/Modules/Platform/Linker/FreeBSD-C.cmake b/Modules/Platform/Linker/FreeBSD-C.cmake index 09975ad50f..bb0cf73a11 100644 --- a/Modules/Platform/Linker/FreeBSD-C.cmake +++ b/Modules/Platform/Linker/FreeBSD-C.cmake @@ -3,13 +3,8 @@ include(Platform/Linker/BSD-Linker-Initialize) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/FreeBSD-GNU-C) else() include(Platform/Linker/FreeBSD-LLD-C) endif() - -endblock() diff --git a/Modules/Platform/Linker/FreeBSD-CXX.cmake b/Modules/Platform/Linker/FreeBSD-CXX.cmake index 9dcb17a618..6440e1859f 100644 --- a/Modules/Platform/Linker/FreeBSD-CXX.cmake +++ b/Modules/Platform/Linker/FreeBSD-CXX.cmake @@ -3,13 +3,8 @@ include(Platform/Linker/BSD-Linker-Initialize) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/FreeBSD-GNU-CXX) else() include(Platform/Linker/FreeBSD-LLD-CXX) endif() - -endblock() diff --git a/Modules/Platform/Linker/FreeBSD-Fortran.cmake b/Modules/Platform/Linker/FreeBSD-Fortran.cmake index 793e0a6a0e..56f6fbb06d 100644 --- a/Modules/Platform/Linker/FreeBSD-Fortran.cmake +++ b/Modules/Platform/Linker/FreeBSD-Fortran.cmake @@ -3,13 +3,8 @@ include(Platform/Linker/BSD-Linker-Initialize) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/FreeBSD-GNU-Fortran) else() include(Platform/Linker/FreeBSD-LLD-Fortran) endif() - -endblock() diff --git a/Modules/Platform/Linker/GNU.cmake b/Modules/Platform/Linker/GNU.cmake index 5f1167418b..b4c47bd7c1 100644 --- a/Modules/Platform/Linker/GNU.cmake +++ b/Modules/Platform/Linker/GNU.cmake @@ -5,9 +5,6 @@ # This module is shared by multiple languages; use include blocker. include_guard() -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - # WHOLE_ARCHIVE Feature for LINK_LIBRARY generator expression ## check linker capabilities function(__cmake_set_whole_archive_feature __linker) @@ -47,5 +44,3 @@ endfunction() ## Configure system linker __cmake_set_whole_archive_feature("${CMAKE_LINKER}") - -endblock() diff --git a/Modules/Platform/Linker/OpenBSD-ASM.cmake b/Modules/Platform/Linker/OpenBSD-ASM.cmake index cd0b25e8c4..132d875d94 100644 --- a/Modules/Platform/Linker/OpenBSD-ASM.cmake +++ b/Modules/Platform/Linker/OpenBSD-ASM.cmake @@ -3,13 +3,8 @@ include(Platform/Linker/BSD-Linker-Initialize) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/OpenBSD-GNU-ASM) else() include(Platform/Linker/OpenBSD-LLD-ASM) endif() - -endblock() diff --git a/Modules/Platform/Linker/OpenBSD-C.cmake b/Modules/Platform/Linker/OpenBSD-C.cmake index 6685807d26..b4147c678c 100644 --- a/Modules/Platform/Linker/OpenBSD-C.cmake +++ b/Modules/Platform/Linker/OpenBSD-C.cmake @@ -3,13 +3,8 @@ include(Platform/Linker/BSD-Linker-Initialize) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/OpenBSD-GNU-C) else() include(Platform/Linker/OpenBSD-LLD-C) endif() - -endblock() diff --git a/Modules/Platform/Linker/OpenBSD-CXX.cmake b/Modules/Platform/Linker/OpenBSD-CXX.cmake index 4a3d6f8017..75d4ff003f 100644 --- a/Modules/Platform/Linker/OpenBSD-CXX.cmake +++ b/Modules/Platform/Linker/OpenBSD-CXX.cmake @@ -3,13 +3,8 @@ include(Platform/Linker/BSD-Linker-Initialize) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/OpenBSD-GNU-CXX) else() include(Platform/Linker/OpenBSD-LLD-CXX) endif() - -endblock() diff --git a/Modules/Platform/Linker/OpenBSD-Fortran.cmake b/Modules/Platform/Linker/OpenBSD-Fortran.cmake index 4ec2fe5a1c..a718403e3d 100644 --- a/Modules/Platform/Linker/OpenBSD-Fortran.cmake +++ b/Modules/Platform/Linker/OpenBSD-Fortran.cmake @@ -3,13 +3,8 @@ include(Platform/Linker/BSD-Linker-Initialize) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") include(Platform/Linker/OpenBSD-GNU-Fortran) else() include(Platform/Linker/OpenBSD-LLD-Fortran) endif() - -endblock() diff --git a/Modules/Platform/Linker/SunOS-Solaris.cmake b/Modules/Platform/Linker/SunOS-Solaris.cmake index 324108c861..2aff3aaef3 100644 --- a/Modules/Platform/Linker/SunOS-Solaris.cmake +++ b/Modules/Platform/Linker/SunOS-Solaris.cmake @@ -5,9 +5,6 @@ # This module is shared by multiple languages; use include blocker. include_guard() -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - macro(__sunos_linker_solaris lang) set(CMAKE_${lang}_PLATFORM_LINKER_ID Solaris) # Features for LINK_LIBRARY generator expression @@ -24,5 +21,3 @@ macro(__sunos_linker_solaris lang) set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) set(CMAKE_${lang}_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) endmacro() - -endblock() diff --git a/Modules/Platform/Linker/Windows-ASM.cmake b/Modules/Platform/Linker/Windows-ASM.cmake index bddaed1724..b6e9ab3a30 100644 --- a/Modules/Platform/Linker/Windows-ASM.cmake +++ b/Modules/Platform/Linker/Windows-ASM.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_ASM_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/Windows-MSVC-ASM) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/Windows-GNU-ASM) endif() - -endblock() diff --git a/Modules/Platform/Linker/Windows-C.cmake b/Modules/Platform/Linker/Windows-C.cmake index 4a584076ee..bb663e3bc6 100644 --- a/Modules/Platform/Linker/Windows-C.cmake +++ b/Modules/Platform/Linker/Windows-C.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/Windows-MSVC-C) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/Windows-GNU-C) endif() - -endblock() diff --git a/Modules/Platform/Linker/Windows-CXX.cmake b/Modules/Platform/Linker/Windows-CXX.cmake index 29768511da..adaeb05d07 100644 --- a/Modules/Platform/Linker/Windows-CXX.cmake +++ b/Modules/Platform/Linker/Windows-CXX.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/Windows-MSVC-CXX) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/Windows-GNU-CXX) endif() - -endblock() diff --git a/Modules/Platform/Linker/Windows-Fortran.cmake b/Modules/Platform/Linker/Windows-Fortran.cmake index 928f6d595e..9a2fcbcb4e 100644 --- a/Modules/Platform/Linker/Windows-Fortran.cmake +++ b/Modules/Platform/Linker/Windows-Fortran.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_Fortran_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/Windows-MSVC-Fortran) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/Windows-GNU-Fortran) endif() - -endblock() diff --git a/Modules/Platform/Linker/Windows-HIP.cmake b/Modules/Platform/Linker/Windows-HIP.cmake index 67b37d13eb..d215fc9e52 100644 --- a/Modules/Platform/Linker/Windows-HIP.cmake +++ b/Modules/Platform/Linker/Windows-HIP.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_HIP_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/Windows-MSVC-HIP) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/Windows-GNU-HIP) endif() - -endblock() diff --git a/Modules/Platform/Linker/Windows-LLD.cmake b/Modules/Platform/Linker/Windows-LLD.cmake index 5054745ca2..9c56de2aeb 100644 --- a/Modules/Platform/Linker/Windows-LLD.cmake +++ b/Modules/Platform/Linker/Windows-LLD.cmake @@ -5,9 +5,6 @@ # This module is shared by multiple languages; use include blocker. include_guard() -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - macro(__windows_linker_lld lang) set(CMAKE_${lang}_PLATFORM_LINKER_ID LLD) # Features for LINK_LIBRARY generator expression @@ -21,5 +18,3 @@ macro(__windows_linker_lld lang) __windows_linker_msvc(${lang}) endif() endmacro() - -endblock() diff --git a/Modules/Platform/Linker/Windows-MSVC.cmake b/Modules/Platform/Linker/Windows-MSVC.cmake index 18c21029e0..491b8993f5 100644 --- a/Modules/Platform/Linker/Windows-MSVC.cmake +++ b/Modules/Platform/Linker/Windows-MSVC.cmake @@ -5,9 +5,6 @@ # This module is shared by multiple languages; use include blocker. include_guard() -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - # Features for LINK_LIBRARY generator expression if(MSVC_VERSION GREATER "1900") ## WHOLE_ARCHIVE: Force loading all members of an archive @@ -32,5 +29,3 @@ macro(__windows_linker_msvc lang) endif() endif() endmacro() - -endblock() diff --git a/Modules/Platform/Linker/WindowsPhone-ASM.cmake b/Modules/Platform/Linker/WindowsPhone-ASM.cmake index 39b77f5cdf..1bfb6eca35 100644 --- a/Modules/Platform/Linker/WindowsPhone-ASM.cmake +++ b/Modules/Platform/Linker/WindowsPhone-ASM.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_ASM_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/WindowsPhone-MSVC-ASM) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/WindowsPhone-GNU-ASM) endif() - -endblock() diff --git a/Modules/Platform/Linker/WindowsPhone-C.cmake b/Modules/Platform/Linker/WindowsPhone-C.cmake index 021310c465..0dde95c2bf 100644 --- a/Modules/Platform/Linker/WindowsPhone-C.cmake +++ b/Modules/Platform/Linker/WindowsPhone-C.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/WindowsPhone-MSVC-C) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/WindowsPhone-GNU-C) endif() - -endblock() diff --git a/Modules/Platform/Linker/WindowsPhone-CXX.cmake b/Modules/Platform/Linker/WindowsPhone-CXX.cmake index a42075f089..88234b0def 100644 --- a/Modules/Platform/Linker/WindowsPhone-CXX.cmake +++ b/Modules/Platform/Linker/WindowsPhone-CXX.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/WindowsPhone-MSVC-CXX) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/WindowsPhone-GNU-CXX) endif() - -endblock() diff --git a/Modules/Platform/Linker/WindowsStore-ASM.cmake b/Modules/Platform/Linker/WindowsStore-ASM.cmake index 1d753f3ea8..a059405e61 100644 --- a/Modules/Platform/Linker/WindowsStore-ASM.cmake +++ b/Modules/Platform/Linker/WindowsStore-ASM.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_ASM_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/WindowsStore-MSVC-ASM) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/WindowsStore-GNU-ASM) endif() - -endblock() diff --git a/Modules/Platform/Linker/WindowsStore-C.cmake b/Modules/Platform/Linker/WindowsStore-C.cmake index cfba4bc35c..14fcd3ba6b 100644 --- a/Modules/Platform/Linker/WindowsStore-C.cmake +++ b/Modules/Platform/Linker/WindowsStore-C.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/WindowsStore-MSVC-C) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/WindowsStore-GNU-C) endif() - -endblock() diff --git a/Modules/Platform/Linker/WindowsStore-CXX.cmake b/Modules/Platform/Linker/WindowsStore-CXX.cmake index f2a4e29aca..a74830c0f1 100644 --- a/Modules/Platform/Linker/WindowsStore-CXX.cmake +++ b/Modules/Platform/Linker/WindowsStore-CXX.cmake @@ -1,9 +1,6 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0054 NEW) - if(CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") # MSVC is the default linker include(Platform/Linker/WindowsStore-MSVC-CXX) @@ -11,5 +8,3 @@ else() # GNU is the default linker include(Platform/Linker/WindowsStore-GNU-CXX) endif() - -endblock() diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 5603fb055c..15b327c6e4 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -25,7 +25,6 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmValue.h" -#include "cmake.h" namespace { auto const keyAND = "AND"_s; @@ -219,7 +218,6 @@ cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile, cmListFileBacktrace bt) : Makefile(makefile) , Backtrace(std::move(bt)) - , Policy54Status(makefile.GetPolicyStatus(cmPolicies::CMP0054)) , Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057)) , Policy64Status(makefile.GetPolicyStatus(cmPolicies::CMP0064)) , Policy139Status(makefile.GetPolicyStatus(cmPolicies::CMP0139)) @@ -298,32 +296,11 @@ bool cmConditionEvaluator::IsTrue( cmValue cmConditionEvaluator::GetDefinitionIfUnquoted( cmExpandedCommandArgument const& argument) const { - if ((this->Policy54Status != cmPolicies::WARN && - this->Policy54Status != cmPolicies::OLD) && - argument.WasQuoted()) { + if (argument.WasQuoted()) { return nullptr; } - cmValue def = this->Makefile.GetDefinition(argument.GetValue()); - - if (def && argument.WasQuoted() && - this->Policy54Status == cmPolicies::WARN) { - if (!this->Makefile.HasCMP0054AlreadyBeenReported(this->Backtrace.Top())) { - std::ostringstream e; - // clang-format off - e << (cmPolicies::GetPolicyWarning(cmPolicies::CMP0054)) - << "\n" - "Quoted variables like \"" << argument.GetValue() << "\" " - "will no longer be dereferenced when the policy is set to NEW. " - "Since the policy is not set the OLD behavior will be used."; - // clang-format on - - this->Makefile.GetCMakeInstance()->IssueMessage( - MessageType::AUTHOR_WARNING, e.str(), this->Backtrace); - } - } - - return def; + return this->Makefile.GetDefinition(argument.GetValue()); } //========================================================================= @@ -344,33 +321,11 @@ bool cmConditionEvaluator::IsKeyword( cm::static_string_view keyword, const cmExpandedCommandArgument& argument) const { - if ((this->Policy54Status != cmPolicies::WARN && - this->Policy54Status != cmPolicies::OLD) && - argument.WasQuoted()) { + if (argument.WasQuoted()) { return false; } - const auto isKeyword = argument.GetValue() == keyword; - - if (isKeyword && argument.WasQuoted() && - this->Policy54Status == cmPolicies::WARN) { - if (!this->Makefile.HasCMP0054AlreadyBeenReported(this->Backtrace.Top())) { - std::ostringstream e; - // clang-format off - e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0054) - << "\n" - "Quoted keywords like \"" << argument.GetValue() << "\" " - "will no longer be interpreted as keywords " - "when the policy is set to NEW. " - "Since the policy is not set the OLD behavior will be used."; - // clang-format on - - this->Makefile.GetCMakeInstance()->IssueMessage( - MessageType::AUTHOR_WARNING, e.str(), this->Backtrace); - } - } - - return isKeyword; + return argument.GetValue() == keyword; } //========================================================================= diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 796f38c622..1990f5fca3 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -31,7 +31,6 @@ public: private: class cmArgumentList; - // Filter the given variable definition based on policy CMP0054. cmValue GetDefinitionIfUnquoted( const cmExpandedCommandArgument& argument) const; @@ -67,7 +66,6 @@ private: cmMakefile& Makefile; cmListFileBacktrace Backtrace; - cmPolicies::PolicyStatus Policy54Status; cmPolicies::PolicyStatus Policy57Status; cmPolicies::PolicyStatus Policy64Status; cmPolicies::PolicyStatus Policy139Status; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6752537487..ad72486e24 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4103,12 +4103,6 @@ cmMakefile::VariablePushPop::~VariablePushPop() this->Makefile->PopSnapshot(); } -bool cmMakefile::HasCMP0054AlreadyBeenReported( - cmListFileContext const& context) const -{ - return !this->CMP0054ReportedIds.insert(context).second; -} - void cmMakefile::RecordPolicies(cmPolicies::PolicyMap& pm) const { /* Record the setting of every policy. */ diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d05421f59c..199995b9cd 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -417,12 +417,6 @@ public: cmMakefile* Makefile; }; - /** - * Determine if the given context, name pair has already been reported - * in context of CMP0054. - */ - bool HasCMP0054AlreadyBeenReported(const cmListFileContext& context) const; - bool IgnoreErrorsCMP0061() const; std::string const& GetHomeDirectory() const; @@ -1103,8 +1097,6 @@ protected: // add link libraries and directories to the target void AddGlobalLinkInformation(cmTarget& target); - mutable std::set CMP0054ReportedIds; - // libraries, classes, and executables mutable cmTargetMap Targets; std::map AliasTargets; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 0ca09a9644..73fcb277d0 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -162,7 +162,7 @@ class cmMakefile; SELECT( \ POLICY, CMP0054, \ "Only interpret if() arguments as variables or keywords when unquoted.", \ - 3, 1, 0, WARN) \ + 3, 1, 0, NEW) \ SELECT(POLICY, CMP0055, "Strict checking for break() command.", 3, 2, 0, \ WARN) \ SELECT(POLICY, CMP0056, \ diff --git a/Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt deleted file mode 100644 index f5a8fbe6e9..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-NEW.cmake b/Tests/RunCMake/CMP0054/CMP0054-NEW.cmake index 23a9124760..bbe2ea4b79 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-NEW.cmake +++ b/Tests/RunCMake/CMP0054/CMP0054-NEW.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0054 NEW) - set(FOO "BAR") set(BAZ "ZZZ") set(MYTRUE ON) diff --git a/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt deleted file mode 100644 index 0500280cd5..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -^CMake Deprecation Warning at CMP0054-OLD.cmake:1 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/CMP0054/CMP0054-OLD.cmake b/Tests/RunCMake/CMP0054/CMP0054-OLD.cmake deleted file mode 100644 index 0c4cede6ba..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-OLD.cmake +++ /dev/null @@ -1,47 +0,0 @@ -cmake_policy(SET CMP0054 OLD) - -set(FOO "BAR") -set(BAZ "ZZZ") -set(MYTRUE ON) -set(MYNUMBER 3) -set(MYVERSION 3.0) - -function(assert_unquoted PREFIX FIRST) - string(REPLACE ";" " " ARGN_SP "${ARGN}") - if(${PREFIX} ${FIRST} ${ARGN}) - message(FATAL_ERROR "Assertion failed [${PREFIX} ${FIRST} ${ARGN_SP}]") - endif() -endfunction() - -function(assert_quoted PREFIX FIRST) - string(REPLACE ";" " " ARGN_SP "${ARGN}") - if(${PREFIX} "${FIRST}" ${ARGN}) - message(FATAL_ERROR "Assertion failed [${PREFIX} \"${FIRST}\" ${ARGN_SP}]") - endif() -endfunction() - -function(assert FIRST) - assert_unquoted(NOT ${FIRST} ${ARGN}) - assert_quoted(NOT ${FIRST} ${ARGN}) -endfunction() - -assert(MYTRUE) - -assert(FOO MATCHES "^BAR$") - -assert(MYNUMBER LESS 4) -assert(MYNUMBER GREATER 2) -assert(MYNUMBER EQUAL 3) - -assert(FOO STRLESS CCC) -assert(BAZ STRGREATER CCC) -assert(FOO STREQUAL BAR) - -assert_unquoted(NOT MYVERSION VERSION_LESS 3.1) -assert_unquoted("" MYVERSION VERSION_LESS 2.9) - -assert_quoted("" MYVERSION VERSION_LESS 2.9) -assert_quoted(NOT MYVERSION VERSION_LESS 3.1) - -assert(MYVERSION VERSION_GREATER 2.9) -assert(MYVERSION VERSION_EQUAL 3.0) diff --git a/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt deleted file mode 100644 index 3cfa5d2e66..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt +++ /dev/null @@ -1,23 +0,0 @@ -CMake Warning \(dev\) at CMP0054-WARN.cmake:3 \(if\): - Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or - keywords when unquoted. Run "cmake --help-policy CMP0054" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - Quoted variables like "FOO" will no longer be dereferenced when the policy - is set to NEW. Since the policy is not set the OLD behavior will be used. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. -+ -CMake Warning \(dev\) at CMP0054-WARN.cmake:5 \(elseif\): - Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or - keywords when unquoted. Run "cmake --help-policy CMP0054" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - Quoted variables like "FOO" will no longer be dereferenced when the policy - is set to NEW. Since the policy is not set the OLD behavior will be used. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake b/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake deleted file mode 100644 index a6089293b9..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set(FOO "BAR") - -if(NOT "FOO" STREQUAL "BAR") - message(FATAL_ERROR "The given literals should match") -elseif("FOO" STREQUAL "BING") - message(FATAL_ERROR "The given literals should not match") -endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings-stderr.txt deleted file mode 100644 index 485db527da..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings-stderr.txt +++ /dev/null @@ -1,24 +0,0 @@ -CMake Warning \(dev\) at CMP0054-duplicate-warnings.cmake:4 \(if\): - Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or - keywords when unquoted. Run "cmake --help-policy CMP0054" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - Quoted variables like "FOO" will no longer be dereferenced when the policy - is set to NEW. Since the policy is not set the OLD behavior will be used. -Call Stack \(most recent call first\): - CMP0054-duplicate-warnings.cmake:8 \(generate_warning\) - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at CMP0054-duplicate-warnings.cmake:11 \(if\): - Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or - keywords when unquoted. Run "cmake --help-policy CMP0054" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - Quoted variables like "FOO" will no longer be dereferenced when the policy - is set to NEW. Since the policy is not set the OLD behavior will be used. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings.cmake b/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings.cmake deleted file mode 100644 index 04fbe14e64..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings.cmake +++ /dev/null @@ -1,12 +0,0 @@ -set(FOO "BAR") - -function(generate_warning) - if("FOO" STREQUAL "BAR") - endif() -endfunction() - -generate_warning() -generate_warning() - -if("FOO" STREQUAL "BAR") -endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-stderr.txt index f44468449d..429803ec18 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at CMP0054-keywords-NEW.cmake:23 \(if\): +CMake Error at CMP0054-keywords-NEW.cmake:21 \(if\): if given arguments: "NOT" "1" diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW.cmake b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW.cmake index b957658b01..445b5eabe0 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW.cmake +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0054 NEW) - function(assert KEYWORD) if("${KEYWORD}" STREQUAL "${KEYWORD}") else() diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt deleted file mode 100644 index 60303cd86c..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -^CMake Deprecation Warning at CMP0054-keywords-OLD.cmake:1 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD.cmake b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD.cmake deleted file mode 100644 index a2a7f51833..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD.cmake +++ /dev/null @@ -1,9 +0,0 @@ -cmake_policy(SET CMP0054 OLD) - -if(NOT 1) - message(FATAL_ERROR "[NOT 1] evaluated true") -endif() - -if("NOT" 1) - message(FATAL_ERROR "[\"NOT\" 1] evaluated true") -endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt deleted file mode 100644 index 5a8c263d7b..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt +++ /dev/null @@ -1,25 +0,0 @@ -CMake Warning \(dev\) at CMP0054-keywords-WARN.cmake:1 \(if\): - Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or - keywords when unquoted. Run "cmake --help-policy CMP0054" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - Quoted keywords like "NOT" will no longer be interpreted as keywords when - the policy is set to NEW. Since the policy is not set the OLD behavior - will be used. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. -+ -CMake Warning \(dev\) at CMP0054-keywords-WARN.cmake:3 \(elseif\): - Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or - keywords when unquoted. Run "cmake --help-policy CMP0054" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - Quoted keywords like "DEFINED" will no longer be interpreted as keywords - when the policy is set to NEW. Since the policy is not set the OLD - behavior will be used. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake deleted file mode 100644 index 118ab3d184..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if("NOT" 1) - message(FATAL_ERROR "[\"NOT\" 1] evaluated true") -elseif("DEFINED" NotDefined) - message(FATAL_ERROR "[\"DEFINED\" NotDefined] evaluated true") -endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt deleted file mode 100644 index 1b354728d4..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -^CMake Deprecation Warning at CMP0054-policy-command-scope.cmake:25 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope.cmake deleted file mode 100644 index b6b243caa2..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope.cmake +++ /dev/null @@ -1,53 +0,0 @@ -set(FOO BAR) - -cmake_policy(SET CMP0054 NEW) - -function(function_defined_new_called_old) - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() -endfunction() - -macro(macro_defined_new_called_old) - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() -endmacro() - -cmake_policy(SET CMP0054 OLD) - -function_defined_new_called_old() -macro_defined_new_called_old() - -function(function_defined_old_called_new) - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() -endfunction() - -macro(macro_defined_old_called_new) - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() -endmacro() - -cmake_policy(SET CMP0054 NEW) - -function_defined_old_called_new() -macro_defined_old_called_new() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt deleted file mode 100644 index 4eac90eedb..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt +++ /dev/null @@ -1,54 +0,0 @@ -^CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:14 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:14 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:27 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:48 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:48 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope.cmake deleted file mode 100644 index 87c968a06d..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope.cmake +++ /dev/null @@ -1,49 +0,0 @@ -set(FOO BAR) - -cmake_policy(SET CMP0054 NEW) - -foreach(loop_var arg1 arg2) - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() - - cmake_policy(SET CMP0054 OLD) - - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() - - cmake_policy(SET CMP0054 NEW) -endforeach() - -cmake_policy(SET CMP0054 OLD) - -foreach(loop_var arg1 arg2) - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() - - cmake_policy(SET CMP0054 NEW) - - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() - - cmake_policy(SET CMP0054 OLD) -endforeach() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt deleted file mode 100644 index a2dd62e4ac..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -^CMake Deprecation Warning at CMP0054-policy-nested-if.cmake:23 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if.cmake deleted file mode 100644 index dd7434d730..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if.cmake +++ /dev/null @@ -1,41 +0,0 @@ -set(FOO BAR) - -cmake_policy(SET CMP0054 NEW) - -if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() - - cmake_policy(SET CMP0054 OLD) - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() -endif() - -if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") -endif() - -cmake_policy(SET CMP0054 OLD) - -if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() - - cmake_policy(SET CMP0054 NEW) - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() -endif() - -if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") -endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt deleted file mode 100644 index 718904d39d..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt +++ /dev/null @@ -1,54 +0,0 @@ -^CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:16 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:16 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:37 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:58 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:58 \(cmake_policy\): - The OLD behavior for policy CMP0054 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake deleted file mode 100644 index 7fb836eb22..0000000000 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake +++ /dev/null @@ -1,65 +0,0 @@ -set(FOO BAR) - -set(LOOP_VAR "") - -cmake_policy(SET CMP0054 NEW) - -while(NOT LOOP_VAR STREQUAL "xx") - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() - - cmake_policy(SET CMP0054 OLD) - - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() - - cmake_policy(SET CMP0054 NEW) - - string(APPEND LOOP_VAR "x") -endwhile() - -while("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") -endwhile() - -set(LOOP_VAR "") - -cmake_policy(SET CMP0054 OLD) - -while(NOT LOOP_VAR STREQUAL "xx") - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") - endif() - - cmake_policy(SET CMP0054 NEW) - - if(NOT FOO STREQUAL BAR) - message(FATAL_ERROR "The variable should match the string") - endif() - - if("FOO" STREQUAL BAR) - message(FATAL_ERROR "The strings should not match") - endif() - - cmake_policy(SET CMP0054 OLD) - - string(APPEND LOOP_VAR "x") -endwhile() - -if(NOT "FOO" STREQUAL BAR) - message(FATAL_ERROR "The quoted variable should match the string") -endif() diff --git a/Tests/RunCMake/CMP0054/CMakeLists.txt b/Tests/RunCMake/CMP0054/CMakeLists.txt index 2897109554..bf2ef1506e 100644 --- a/Tests/RunCMake/CMP0054/CMakeLists.txt +++ b/Tests/RunCMake/CMP0054/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0054/RunCMakeTest.cmake b/Tests/RunCMake/CMP0054/RunCMakeTest.cmake index fc031de9fb..99ac7f4fad 100644 --- a/Tests/RunCMake/CMP0054/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0054/RunCMakeTest.cmake @@ -1,14 +1,4 @@ include(RunCMake) -set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON) -run_cmake(CMP0054-OLD) run_cmake(CMP0054-NEW) -run_cmake(CMP0054-WARN) run_cmake(CMP0054-keywords-NEW) -run_cmake(CMP0054-keywords-OLD) -run_cmake(CMP0054-keywords-WARN) -run_cmake(CMP0054-duplicate-warnings) -run_cmake(CMP0054-policy-command-scope) -run_cmake(CMP0054-policy-foreach-scope) -run_cmake(CMP0054-policy-while-scope) -run_cmake(CMP0054-policy-nested-if) diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 49c345cace..117b0cd292 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -1,7 +1,6 @@ cmake_policy(SET CMP0057 NEW) include(RunCMake) -cmake_policy(SET CMP0054 NEW) if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) run_cmake(LanguageStandard) diff --git a/Tests/RunCMake/list/POP_BACK.cmake b/Tests/RunCMake/list/POP_BACK.cmake index 4794796325..cf6cb36587 100644 --- a/Tests/RunCMake/list/POP_BACK.cmake +++ b/Tests/RunCMake/list/POP_BACK.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0054 NEW) - function(assert_expected_list_len list_var expected_size) list(LENGTH ${list_var} _size) if(NOT _size EQUAL ${expected_size}) diff --git a/Tests/RunCMake/list/POP_FRONT.cmake b/Tests/RunCMake/list/POP_FRONT.cmake index 70f757a27a..dfbb378449 100644 --- a/Tests/RunCMake/list/POP_FRONT.cmake +++ b/Tests/RunCMake/list/POP_FRONT.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0054 NEW) - function(assert_expected_list_len list_var expected_size) list(LENGTH ${list_var} _size) if(NOT _size EQUAL ${expected_size}) diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake index 3ebe2691e2..6dbadaa365 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake @@ -1,8 +1,6 @@ include(RunCMake) -cmake_policy(SET CMP0054 NEW) - macro(run_cmake_target test subtest target) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) set(RunCMake_TEST_NO_CLEAN 1) diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake index 97a96b4d43..2e7efa78ef 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake @@ -1,8 +1,6 @@ include(RunCMake) -cmake_policy(SET CMP0054 NEW) - macro(run_cmake_target test subtest target) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) set(RunCMake_TEST_NO_CLEAN 1)