diff --git a/Help/policy/CMP0057.rst b/Help/policy/CMP0057.rst index 07bc96969c..4c78568e07 100644 --- a/Help/policy/CMP0057.rst +++ b/Help/policy/CMP0057.rst @@ -1,6 +1,9 @@ CMP0057 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + .. versionadded:: 3.3 Support new :command:`if` IN_LIST operator. @@ -11,7 +14,5 @@ The ``OLD`` behavior for this policy is to ignore the IN_LIST operator. The ``NEW`` behavior is to interpret the IN_LIST operator. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3 -.. |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/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 5307901be4..df5248714d 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -247,9 +247,6 @@ if(DEFINED CMAKE_GENERATOR) endif() endif() -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - # The functions defined in this file depend on the get_prerequisites function # (and possibly others) found in: # @@ -1127,5 +1124,3 @@ function(verify_app app) message(FATAL_ERROR "error: verify_app failed") endif() endfunction() - -cmake_policy(POP) diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index dc28f128d5..7796321a93 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -20,9 +20,6 @@ # on UNIX, cygwin and mingw -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - # Resolve full path of CMAKE_TOOL from user-defined name and SEARCH_PATH. function(__resolve_tool_path CMAKE_TOOL SEARCH_PATH DOCSTRING) @@ -274,5 +271,3 @@ if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^xIAR$") set(CMAKE_IAR_LINKER "${CMAKE_LINKER}" CACHE FILEPATH "The IAR ILINK linker") mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_AR) endif() - -cmake_policy(POP) diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake index fbbe65fcd3..925e8a84c0 100644 --- a/Modules/CMakeIOSInstallCombined.cmake +++ b/Modules/CMakeIOSInstallCombined.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 CMP0057 NEW) # if IN_LIST - # Function to print messages of this module function(_ios_install_combined_message) message(STATUS "[iOS combined] " ${ARGN}) @@ -319,5 +316,3 @@ function(ios_install_combined target destination) _ios_install_combined_message("Install done: ${destination}") endfunction() - -cmake_policy(POP) diff --git a/Modules/CSharpUtilities.cmake b/Modules/CSharpUtilities.cmake index cd4416905a..44c9df5755 100644 --- a/Modules/CSharpUtilities.cmake +++ b/Modules/CSharpUtilities.cmake @@ -186,9 +186,6 @@ Helper functions which are used by the above ones #]=======================================================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - function(csharp_get_filename_keys OUT) set(${OUT} "") foreach(f ${ARGN}) @@ -309,5 +306,3 @@ function(csharp_set_xaml_cs_properties) endif() endforeach() endfunction() - -cmake_policy(POP) diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake index 87a41b9a9d..f85da96aa2 100644 --- a/Modules/Compiler/ARMClang.cmake +++ b/Modules/Compiler/ARMClang.cmake @@ -12,9 +12,6 @@ set(_ARMClang_CMAKE_LOADED TRUE) # Save the CMP0123 setting in a variable used both below and by try_compile. cmake_policy(GET CMP0123 CMAKE_ARMClang_CMP0123) -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - set(CMAKE_EXECUTABLE_SUFFIX ".elf") if (CMAKE_LINKER MATCHES "armlink") @@ -142,5 +139,3 @@ macro(__compiler_armclang lang) set(CMAKE_${lang}_OUTPUT_EXTENSION ".o") set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1) endmacro() - -cmake_policy(POP) diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake index f6e46acaac..8bdc982205 100644 --- a/Modules/Compiler/CrayPrgEnv.cmake +++ b/Modules/Compiler/CrayPrgEnv.cmake @@ -7,9 +7,6 @@ set(__cmake_craype_crayprgenv 1) # CrayPrgEnv: loaded when compiling through the Cray compiler wrapper. # The compiler wrapper can run on a front-end node or a compute node. -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - # One-time setup of the craype environment. First, check the wrapper config. # The wrapper's selection of a compiler (gcc, clang, intel, etc.) and # default include/library paths is selected using the "module" command. @@ -132,5 +129,3 @@ macro(__CrayPrgEnv_setup lang) endif() endmacro() - -cmake_policy(POP) diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake index 7dd03f35a3..bd74e2baa1 100644 --- a/Modules/Compiler/IAR-CXX.cmake +++ b/Modules/Compiler/IAR-CXX.cmake @@ -16,9 +16,6 @@ endif() # Whenever needed, override this default behavior using CMAKE_IAR_CXX_FLAG in your toolchain file. if(NOT CMAKE_IAR_CXX_FLAG) - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) # if IN_LIST - set(_CMAKE_IAR_MODERNCXX_LIST 14 17) if(${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} IN_LIST _CMAKE_IAR_MODERNCXX_LIST OR ("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" AND ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} EQUAL 98)) @@ -27,8 +24,6 @@ if(NOT CMAKE_IAR_CXX_FLAG) set(CMAKE_IAR_CXX_FLAG --eec++) endif() unset(_CMAKE_IAR_MODERNCXX_LIST) - - cmake_policy(POP) endif() set(CMAKE_CXX_STANDARD_COMPILE_OPTION "") diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 2528f44f14..e2d26ca91d 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1300,9 +1300,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 CMP0057 NEW) # if() supports IN_LIST - define_property(DIRECTORY PROPERTY "EP_BASE" INHERITED) define_property(DIRECTORY PROPERTY "EP_PREFIX" INHERITED) define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED) @@ -3088,5 +3085,3 @@ function(ExternalProject_Add name) # _ep_add_test_command(${name}) endfunction() - -cmake_policy(POP) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 39ddfbed7f..d6647d0d5a 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -400,7 +400,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) # Save project's policies cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var) cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index 5d8ac2ae4d..7b882d7f84 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -400,9 +400,6 @@ Deprecated Hint Variables #]=======================================================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - # For backwards compatibility support if(Doxygen_FIND_QUIETLY) set(DOXYGEN_FIND_QUIETLY TRUE) @@ -1215,5 +1212,3 @@ doxygen_add_docs() for target ${targetName}") endif() endfunction() - -cmake_policy(POP) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 242d36fd0a..c74a6b6bad 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -481,15 +481,12 @@ function(_HDF5_select_imported_config target imported_conf) message(STATUS "Start search through imported configurations in the following order: ${_preferred_confs}") endif() # Now find the first of these that is present in imported_conf - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) # support IN_LISTS foreach (_conf IN LISTS _preferred_confs) if (${_conf} IN_LIST _imported_conf) set(_imported_conf ${_conf}) break() endif() endforeach() - cmake_policy(POP) endif() if(HDF5_FIND_DEBUG) message(STATUS "Selected imported configuration: ${_imported_conf}") diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index e807750ea4..ac3af76827 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -98,9 +98,6 @@ The following cache variables are also available to set or use: The include path to ``jawt.h``. #]=======================================================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) - include(CheckSourceCompiles) include(CMakePushCheckState) include(FindPackageHandleStandardArgs) @@ -692,5 +689,3 @@ if(JNI_FOUND) unset(_JNI_JVM_TYPE) endif() endif() - -cmake_policy(POP) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index a3cdf89396..b6ef962ce9 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -264,7 +264,6 @@ Additionally, the following variables are deprecated: #]=======================================================================] cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 15a0cbe7ca..55f8cbbd46 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -299,7 +299,6 @@ Reference #]=======================================================================] cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ set(_FindMatlab_SELF_DIR "${CMAKE_CURRENT_LIST_DIR}") diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 7664a707ef..cbbf09d7dd 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 CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ function(_OPENMP_FLAG_CANDIDATES LANG) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 0b7325d2ea..a6fb37b460 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -214,11 +214,6 @@ Example for the usage: include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake) -cmake_policy(PUSH) -# IN_LIST operator -cmake_policy(SET CMP0057 NEW) - - # internal helper macro macro(_FPHSA_FAILURE_MESSAGE _msg) set(__msg "${_msg}") @@ -602,6 +597,3 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) endfunction() - - -cmake_policy(POP) diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index e525b3626c..acbab8d5bb 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -33,9 +33,6 @@ for how these variables are initialized. #]========================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - ### Common stuff #### set(PKG_CONFIG_VERSION 1) @@ -1046,5 +1043,3 @@ Variables Affecting Behavior ### Local Variables: ### mode: cmake ### End: - -cmake_policy(POP) diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 229f364ad0..4131a4ef89 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -92,7 +92,6 @@ is set regardless of the presence of the ``Server`` component in find_package ca # ---------------------------------------------------------------------------- cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include") diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index c64731575a..9f6df8052d 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -10,8 +10,6 @@ # cmake_policy(PUSH) -# IN_LIST operator -cmake_policy (SET CMP0057 NEW) # foreach loop variable scope cmake_policy (SET CMP0124 NEW) # registry view behavior diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index 27beaa02e2..e541e776f3 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -66,7 +66,6 @@ The following cache variables may also be set: #]=======================================================================] cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ set(_TIFF_args) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 226211919e..c3ba2db9b9 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -220,7 +220,6 @@ environment. #]=======================================================================] cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ # Provide compatibility with a common invalid component request that diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 88aaf96207..277d5ffccb 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -188,9 +188,6 @@ macro(DBG_MSG_V _MSG) # "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") endmacro() -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - # Clear return values in case the module is loaded more than once. set(wxWidgets_FOUND FALSE) set(wxWidgets_INCLUDE_DIRS "") @@ -1241,5 +1238,3 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles) set(${_outfiles} ${${_outfiles}} PARENT_SCOPE) endfunction() - -cmake_policy(POP) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 8e43f33e41..e866512564 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -174,9 +174,6 @@ Possible types are: other #]=======================================================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - function(gp_append_unique list_var value) if(NOT value IN_LIST ${list_var}) set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE) @@ -1046,5 +1043,3 @@ function(list_prerequisites_by_glob glob_arg glob_exp) endif() endforeach() endfunction() - -cmake_policy(POP) diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake index e98ed175ea..832a69008e 100644 --- a/Modules/Internal/CPack/CPackDeb.cmake +++ b/Modules/Internal/CPack/CPackDeb.cmake @@ -10,9 +10,6 @@ if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.") endif() -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - function(cpack_deb_variable_fallback OUTPUT_VAR_NAME) set(FALLBACK_VAR_NAMES ${ARGN}) @@ -886,5 +883,3 @@ function(cpack_deb_prepare_package_vars) endfunction() cpack_deb_prepare_package_vars() - -cmake_policy(POP) diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index c39eb471d7..5ac5336a69 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -3,9 +3,6 @@ # Author: Eric Noulard with the help of Alexander Neundorf. -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - function(set_spec_script_if_enabled TYPE PACKAGE_NAME VAR) if(NOT "${VAR}" STREQUAL "" AND NOT "${VAR}" STREQUAL "\n") if(PACKAGE_NAME) @@ -1999,5 +1996,3 @@ mv %_topdir/tmpBBroot $RPM_BUILD_ROOT endfunction() cpack_rpm_generate_package() - -cmake_policy(POP) diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake index e1dcfb71c6..a92ddbba1a 100644 --- a/Modules/Internal/CheckSourceCompiles.cmake +++ b/Modules/Internal/CheckSourceCompiles.cmake @@ -3,9 +3,6 @@ include_guard(GLOBAL) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST - function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var) if(NOT DEFINED "${_var}") set(_lang_filename "src") @@ -138,5 +135,3 @@ function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var) endif() endif() endfunction() - -endblock() diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake index d73db5c6fa..8bdd79264f 100644 --- a/Modules/Internal/CheckSourceRuns.cmake +++ b/Modules/Internal/CheckSourceRuns.cmake @@ -3,9 +3,6 @@ include_guard(GLOBAL) -block(SCOPE_FOR POLICIES) -cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST - function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) if(NOT DEFINED "${_var}") @@ -130,5 +127,3 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) endif() endif() endfunction() - -endblock() diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index bab604298d..23c8a18646 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -31,7 +31,6 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") endif() cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ # If using Android tools for Visual Studio, compile a sample project to get the diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index d6510f30b3..b9753e5898 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -394,8 +394,6 @@ Deprecated Commands #]=======================================================================] cmake_policy(PUSH) -# IN_LIST operator -cmake_policy (SET CMP0057 NEW) # Ninja generator normalizes custom command depfile paths cmake_policy (SET CMP0116 NEW) diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 15b327c6e4..555aeedb82 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -218,7 +218,6 @@ cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile, cmListFileBacktrace bt) : Makefile(makefile) , Backtrace(std::move(bt)) - , Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057)) , Policy64Status(makefile.GetPolicyStatus(cmPolicies::CMP0064)) , Policy139Status(makefile.GetPolicyStatus(cmPolicies::CMP0139)) { @@ -665,29 +664,12 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, } else if (this->IsKeyword(keyIN_LIST, *args.next)) { + cmValue lhs = this->GetVariableOrString(*args.current); + cmValue rhs = this->Makefile.GetDefinition(args.nextnext->GetValue()); - if (this->Policy57Status != cmPolicies::OLD && - this->Policy57Status != cmPolicies::WARN) { - - cmValue lhs = this->GetVariableOrString(*args.current); - cmValue rhs = this->Makefile.GetDefinition(args.nextnext->GetValue()); - - newArgs.ReduceTwoArgs( - rhs && - cm::contains(cmList{ *rhs, cmList::EmptyElements::Yes }, *lhs), - args); - } - - else if (this->Policy57Status == cmPolicies::WARN) { - std::ostringstream e; - e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0057) - << "\n" - "IN_LIST will be interpreted as an operator " - "when the policy is set to NEW. " - "Since the policy is not set the OLD behavior will be used."; - - this->Makefile.IssueMessage(MessageType::AUTHOR_WARNING, e.str()); - } + newArgs.ReduceTwoArgs( + rhs && cm::contains(cmList{ *rhs, cmList::EmptyElements::Yes }, *lhs), + args); } else if (this->IsKeyword(keyPATH_EQUAL, *args.next)) { diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 1990f5fca3..bd1edc5930 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -66,7 +66,6 @@ private: cmMakefile& Makefile; cmListFileBacktrace Backtrace; - cmPolicies::PolicyStatus Policy57Status; cmPolicies::PolicyStatus Policy64Status; cmPolicies::PolicyStatus Policy139Status; }; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 8540598864..bea5a5a2dd 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -168,8 +168,7 @@ class cmMakefile; SELECT(POLICY, CMP0056, \ "Honor link flags in try_compile() source-file signature.", 3, 2, 0, \ NEW) \ - SELECT(POLICY, CMP0057, "Support new IN_LIST if() operator.", 3, 3, 0, \ - WARN) \ + SELECT(POLICY, CMP0057, "Support new IN_LIST if() operator.", 3, 3, 0, NEW) \ SELECT(POLICY, CMP0058, \ "Ninja requires custom command byproducts to be explicit.", 3, 3, 0, \ WARN) \ diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 29174e5b92..5bbefe49d6 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.10) -cmake_policy(SET CMP0057 NEW) project(CompileFeatures) diff --git a/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake b/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake index 110a61cda7..5f86f90788 100644 --- a/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake +++ b/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake @@ -25,8 +25,6 @@ set (GENERATE_CONTENT "if (\"${CMAKE_TAPI}\") endif()\n\n") string (APPEND GENERATE_CONTENT [[ -cmake_policy (SET CMP0057 NEW) - macro (CHECK_FILE test_msg path) if (NOT EXISTS "${path}") string (APPEND RunCMake_TEST_FAILED "${test_msg}: \"${path}\" not found\n") diff --git a/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake b/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake index ebd7ba580e..5689868f0f 100644 --- a/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake +++ b/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0057 NEW) - set(MY_NON_EXISTENT_LIST) set(MY_EMPTY_LIST "") diff --git a/Tests/RunCMake/CMP0057/CMP0057-OLD-result.txt b/Tests/RunCMake/CMP0057/CMP0057-OLD-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CMP0057/CMP0057-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CMP0057/CMP0057-OLD-stderr.txt b/Tests/RunCMake/CMP0057/CMP0057-OLD-stderr.txt deleted file mode 100644 index f3fad8da96..0000000000 --- a/Tests/RunCMake/CMP0057/CMP0057-OLD-stderr.txt +++ /dev/null @@ -1,8 +0,0 @@ -CMake Error at CMP0057-OLD.cmake:5 \(if\): - if given arguments: - - "foo" "IN_LIST" "MY_LIST" - - Unknown arguments specified -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0057/CMP0057-OLD.cmake b/Tests/RunCMake/CMP0057/CMP0057-OLD.cmake deleted file mode 100644 index cf9ec890bf..0000000000 --- a/Tests/RunCMake/CMP0057/CMP0057-OLD.cmake +++ /dev/null @@ -1,7 +0,0 @@ -cmake_policy(SET CMP0057 OLD) - -set(MY_LIST foo bar) - -if("foo" IN_LIST MY_LIST) - message("foo is in MY_LIST") -endif() diff --git a/Tests/RunCMake/CMP0057/CMP0057-WARN-result.txt b/Tests/RunCMake/CMP0057/CMP0057-WARN-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CMP0057/CMP0057-WARN-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt b/Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt deleted file mode 100644 index b1c9b63b42..0000000000 --- a/Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt +++ /dev/null @@ -1,19 +0,0 @@ -CMake Warning \(dev\) at CMP0057-WARN.cmake:3 \(if\): - Policy CMP0057 is not set: Support new IN_LIST if\(\) operator. Run "cmake - --help-policy CMP0057" for policy details. Use the cmake_policy command to - set the policy and suppress this warning. - - IN_LIST will be interpreted as an operator 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 Error at CMP0057-WARN.cmake:3 \(if\): - if given arguments: - - "foo" "IN_LIST" "MY_LIST" - - Unknown arguments specified -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0057/CMP0057-WARN.cmake b/Tests/RunCMake/CMP0057/CMP0057-WARN.cmake deleted file mode 100644 index 45f53a52cf..0000000000 --- a/Tests/RunCMake/CMP0057/CMP0057-WARN.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(MY_LIST foo bar) - -if("foo" IN_LIST MY_LIST) - message("foo is in MY_LIST") -endif() diff --git a/Tests/RunCMake/CMP0057/CMakeLists.txt b/Tests/RunCMake/CMP0057/CMakeLists.txt index 18dfd2686f..bf2ef1506e 100644 --- a/Tests/RunCMake/CMP0057/CMakeLists.txt +++ b/Tests/RunCMake/CMP0057/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.10) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0057/RunCMakeTest.cmake b/Tests/RunCMake/CMP0057/RunCMakeTest.cmake index 76eaca6e7f..979158701a 100644 --- a/Tests/RunCMake/CMP0057/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0057/RunCMakeTest.cmake @@ -1,6 +1,3 @@ include(RunCMake) -set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON) -run_cmake(CMP0057-OLD) -run_cmake(CMP0057-WARN) run_cmake(CMP0057-NEW) diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 3ec4c691e0..5d60aacdc6 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0057 NEW) - function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACKAGING_TYPE package_target) if(TEST_TYPE IN_LIST types) string(REGEX MATCH "^[^.]*" GENERATOR_TYPE "${TEST_TYPE}") diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index 47475d36f1..8ed2f97f20 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -1,8 +1,5 @@ include(RunCMake) -# For `if (IN_LIST)` -cmake_policy(SET CMP0057 NEW) - run_cmake(Inspect) include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") diff --git a/Tests/RunCMake/CXXModules/check-json.cmake b/Tests/RunCMake/CXXModules/check-json.cmake index ec15f14765..09edc33e5b 100644 --- a/Tests/RunCMake/CXXModules/check-json.cmake +++ b/Tests/RunCMake/CXXModules/check-json.cmake @@ -1,6 +1,3 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) - function (json_placeholders in out) string(REPLACE "" "${CXXModules_config}" in "${in}") string(TOLOWER "${CXXModules_config}" config_lower) @@ -228,5 +225,3 @@ function (check_json actual expect) set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) endfunction () - -cmake_policy(POP) diff --git a/Tests/RunCMake/CXXModules/examples/build-database-check.cmake b/Tests/RunCMake/CXXModules/examples/build-database-check.cmake index 734b5809f8..c09aceaecd 100644 --- a/Tests/RunCMake/CXXModules/examples/build-database-check.cmake +++ b/Tests/RunCMake/CXXModules/examples/build-database-check.cmake @@ -1,6 +1,3 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) - include("${CMAKE_CURRENT_LIST_DIR}/../check-json.cmake") function (check_build_database expect_basename fname component) @@ -77,5 +74,3 @@ function (check_build_database expect_basename fname component) set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) endfunction () - -cmake_policy(POP) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 487284ba75..508662e2b0 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0057 NEW) include(RunCMake) run_cmake(NotAFeature) diff --git a/Tests/RunCMake/GenEx-TARGET_IMPORT_FILE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-TARGET_IMPORT_FILE/RunCMakeTest.cmake index 04ff640942..5a272418c3 100644 --- a/Tests/RunCMake/GenEx-TARGET_IMPORT_FILE/RunCMakeTest.cmake +++ b/Tests/RunCMake/GenEx-TARGET_IMPORT_FILE/RunCMakeTest.cmake @@ -1,7 +1,5 @@ include(RunCMake) -cmake_policy(SET CMP0057 NEW) - function(run_cmake_with_config test) if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG) set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release) diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake index c8a5c154c7..139d58673c 100644 --- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake +++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0057 NEW) include(RunCMake) function(run_test name) diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 117b0cd292..37f780c786 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0057 NEW) - include(RunCMake) if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) diff --git a/Tests/RunCMake/find_package/CMP0074-common.cmake b/Tests/RunCMake/find_package/CMP0074-common.cmake index bfacd82c4a..80410d1c9c 100644 --- a/Tests/RunCMake/find_package/CMP0074-common.cmake +++ b/Tests/RunCMake/find_package/CMP0074-common.cmake @@ -1,5 +1,4 @@ # (includer selects CMP0074) -cmake_policy(SET CMP0057 NEW) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) diff --git a/Tests/RunCMake/find_package/PackageRoot.cmake b/Tests/RunCMake/find_package/PackageRoot.cmake index aa12e9b5f2..0ce172b65e 100644 --- a/Tests/RunCMake/find_package/PackageRoot.cmake +++ b/Tests/RunCMake/find_package/PackageRoot.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0074 NEW) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) diff --git a/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake index 1ef32cbbaa..cc784ae766 100644 --- a/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake +++ b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0074 NEW) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) diff --git a/Tests/RunCMake/find_package/PackageRootNestedModule.cmake b/Tests/RunCMake/find_package/PackageRootNestedModule.cmake index 017834cd34..82e71a3865 100644 --- a/Tests/RunCMake/find_package/PackageRootNestedModule.cmake +++ b/Tests/RunCMake/find_package/PackageRootNestedModule.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0074 NEW) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) diff --git a/Tests/RunCMake/project/LanguagesDuplicate.cmake b/Tests/RunCMake/project/LanguagesDuplicate.cmake index 97a79d0823..e1f6c9514d 100644 --- a/Tests/RunCMake/project/LanguagesDuplicate.cmake +++ b/Tests/RunCMake/project/LanguagesDuplicate.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0057 NEW) - project(ProjectA C C C) project(ProjectB C C CXX CXX)