mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
CMP0057: Remove support for OLD behavior
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 "")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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_<n>
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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_<n>
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.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_<n>
|
||||
|
||||
set(_FindMatlab_SELF_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
@@ -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_<n>
|
||||
|
||||
function(_OPENMP_FLAG_CANDIDATES LANG)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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_<n>
|
||||
|
||||
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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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_<n>
|
||||
|
||||
set(_TIFF_args)
|
||||
|
||||
@@ -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_<n>
|
||||
|
||||
# Provide compatibility with a common invalid component request that
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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_<n>
|
||||
|
||||
# If using Android tools for Visual Studio, compile a sample project to get the
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -66,7 +66,6 @@ private:
|
||||
|
||||
cmMakefile& Makefile;
|
||||
cmListFileBacktrace Backtrace;
|
||||
cmPolicies::PolicyStatus Policy57Status;
|
||||
cmPolicies::PolicyStatus Policy64Status;
|
||||
cmPolicies::PolicyStatus Policy139Status;
|
||||
};
|
||||
|
||||
+1
-2
@@ -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) \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
|
||||
project(CompileFeatures)
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
|
||||
set(MY_NON_EXISTENT_LIST)
|
||||
|
||||
set(MY_EMPTY_LIST "")
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
1
|
||||
@@ -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\)
|
||||
@@ -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()
|
||||
@@ -1 +0,0 @@
|
||||
1
|
||||
@@ -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\)
|
||||
@@ -1,5 +0,0 @@
|
||||
set(MY_LIST foo bar)
|
||||
|
||||
if("foo" IN_LIST MY_LIST)
|
||||
message("foo is in MY_LIST")
|
||||
endif()
|
||||
@@ -1,3 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.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)
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
|
||||
function (json_placeholders in out)
|
||||
string(REPLACE "<CONFIG>" "${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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(NotAFeature)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
include(RunCMake)
|
||||
|
||||
function(run_test name)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
|
||||
project(ProjectA C C C)
|
||||
project(ProjectB C C CXX CXX)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user