CMP0054: Remove support for OLD behavior

This commit is contained in:
Brad King
2024-12-09 18:50:54 -05:00
parent 292aaffb78
commit 90d814f024
80 changed files with 15 additions and 794 deletions

View File

@@ -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
"""""""""""""""

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()

View File

@@ -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_<n>
#-----------------------------------------------------------------------------

View File

@@ -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)

View File

@@ -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

View File

@@ -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_<n>

View File

@@ -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 ####

View File

@@ -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)

View File

@@ -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)

View File

@@ -6,9 +6,6 @@
# If successful, sets CMAKE_<lang>_COMPILER_LINKER_ID and
# CMAKE_<lang>_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)

View File

@@ -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()

View File

@@ -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()

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()

View File

@@ -6,7 +6,6 @@
include_guard()
block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0140 NEW)
function(__linker_gnu lang)

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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;
}
//=========================================================================

View File

@@ -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;

View File

@@ -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. */

View File

@@ -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<cmListFileContext> CMP0054ReportedIds;
// libraries, classes, and executables
mutable cmTargetMap Targets;
std::map<std::string, std::string> AliasTargets;

View File

@@ -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, \

View File

@@ -1 +0,0 @@
$^

View File

@@ -1,5 +1,3 @@
cmake_policy(SET CMP0054 NEW)
set(FOO "BAR")
set(BAZ "ZZZ")
set(MYTRUE ON)

View File

@@ -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\)$

View File

@@ -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)

View File

@@ -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.

View File

@@ -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()

View File

@@ -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.

View File

@@ -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()

View File

@@ -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"

View File

@@ -1,5 +1,3 @@
cmake_policy(SET CMP0054 NEW)
function(assert KEYWORD)
if("${KEYWORD}" STREQUAL "${KEYWORD}")
else()

View File

@@ -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\)$

View File

@@ -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()

View File

@@ -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.

View File

@@ -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()

View File

@@ -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\)$

View File

@@ -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()

View File

@@ -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\)$

View File

@@ -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()

View File

@@ -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\)$

View File

@@ -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()

View File

@@ -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\)$

View File

@@ -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()

View File

@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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})

View File

@@ -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})

View File

@@ -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)

View File

@@ -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)