mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 06:10:04 -05:00
Merge topic 'remove-old-compatibility'
785523a136Remove compatibility with CMake versions older than 2.8.035282387eaCMP0014: Remove support for OLD behaviorfad9c55b8bCMP0013: Remove support for OLD behavior98a59ba8adCMP0012: Remove support for OLD behavior3c0dbb66f5CMP0011: Remove support for OLD behaviorcf832e75bcCMP0010: Remove support for OLD behavior77f8c374f3CMP0009: Remove support for OLD behavior43ef139567CMP0008: Remove support for OLD behavior ... Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !10188
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
.. versionchanged:: 4.0
|
||||
|
||||
Compatibility with versions of CMake older than 2.8.0 is removed.
|
||||
Calls to :command:`cmake_minimum_required(VERSION)` or
|
||||
:command:`cmake_policy(VERSION)` that do not specify at least
|
||||
2.8.0 as their policy version (optionally via ``...<max>``)
|
||||
will produce an error in CMake 4.0 and above.
|
||||
|
||||
.. versionchanged:: 3.31
|
||||
|
||||
Compatibility with versions of CMake older than 3.10 is deprecated.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0000
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
A minimum required CMake version must be specified.
|
||||
|
||||
CMake requires that projects specify the version of CMake to which
|
||||
@@ -26,7 +29,5 @@ behavior was to silently ignore the missing invocation. The ``NEW``
|
||||
behavior is to issue an error instead of a warning.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
CMP0001
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
``CMAKE_BACKWARDS_COMPATIBILITY`` should no longer be used.
|
||||
|
||||
The behavior is to check ``CMAKE_BACKWARDS_COMPATIBILITY`` and present
|
||||
it to the user. The ``NEW`` behavior is to ignore
|
||||
CMAKE_BACKWARDS_COMPATIBILITY completely.
|
||||
``CMAKE_BACKWARDS_COMPATIBILITY`` completely.
|
||||
|
||||
In CMake 2.4 and below the variable ``CMAKE_BACKWARDS_COMPATIBILITY`` was
|
||||
used to request compatibility with earlier versions of CMake. In
|
||||
@@ -15,7 +18,5 @@ and the :command:`cmake_policy` command. However, CMake must still check
|
||||
below.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0002
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Logical target names must be globally unique.
|
||||
|
||||
Targets names created with :command:`add_executable`, :command:`add_library`, or
|
||||
@@ -22,7 +25,5 @@ must simply have globally unique names (unless one uses the global
|
||||
property :prop_gbl:`ALLOW_DUPLICATE_CUSTOM_TARGETS` with a Makefiles generator).
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0003
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Libraries linked via full path no longer produce linker search paths.
|
||||
|
||||
This policy affects how libraries whose full paths are NOT known are
|
||||
@@ -98,7 +101,5 @@ target. This avoids flooding users with messages for every target
|
||||
when setting the policy once will probably fix all targets.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0004
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Libraries linked may not have leading or trailing whitespace.
|
||||
|
||||
CMake versions 2.4 and below silently removed leading and trailing
|
||||
@@ -20,7 +23,5 @@ target is created by an :command:`add_executable` or :command:`add_library`
|
||||
command.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0005
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Preprocessor definition values are now escaped automatically.
|
||||
|
||||
This policy determines whether or not CMake should generate escaped
|
||||
@@ -20,7 +23,5 @@ See documentation of the ``COMPILE_DEFINITIONS`` target property for
|
||||
limitations of the escaping implementation.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0006
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Installing :prop_tgt:`MACOSX_BUNDLE` targets requires a ``BUNDLE DESTINATION``.
|
||||
|
||||
This policy determines whether the :command:`install(TARGETS)` command must be
|
||||
@@ -18,7 +21,5 @@ behavior for this policy is to produce an error if a bundle target is installed
|
||||
without a ``BUNDLE DESTINATION``.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0007
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
list command no longer ignores empty elements.
|
||||
|
||||
This policy determines whether the list command will ignore empty
|
||||
@@ -11,7 +14,5 @@ elements. The ``NEW`` behavior for this policy is to correctly count
|
||||
empty elements in a list.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0008
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Libraries linked by full-path must have a valid library file name.
|
||||
|
||||
In CMake 2.4 and below it is possible to write code like
|
||||
@@ -29,7 +32,5 @@ it. The ``NEW`` behavior for this policy is to trust the given path and
|
||||
pass it directly to the native build tool unchanged.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0009
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
FILE GLOB_RECURSE calls should not follow symlinks by default.
|
||||
|
||||
In CMake 2.6.1 and below, :command:`file(GLOB_RECURSE)` calls would follow
|
||||
@@ -15,7 +18,5 @@ to follow the symlinks by default, but only if ``FOLLOW_SYMLINKS`` is given
|
||||
as an additional argument to the ``FILE`` command.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.2
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0010
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Bad variable reference syntax is an error.
|
||||
|
||||
In CMake 2.6.2 and below, incorrect variable reference syntax such as
|
||||
@@ -14,7 +17,5 @@ If :policy:`CMP0053` is set to ``NEW``, this policy has no effect
|
||||
and is treated as always being ``NEW``.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0011
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Included scripts do automatic :command:`cmake_policy` PUSH and POP.
|
||||
|
||||
In CMake 2.6.2 and below, CMake Policy settings in scripts loaded by
|
||||
@@ -19,7 +22,5 @@ The ``NEW`` behavior for this policy is to allow the commands to do
|
||||
their default cmake_policy ``PUSH`` and ``POP``.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0012
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
:command:`if` recognizes numbers and boolean constants.
|
||||
|
||||
In CMake versions 2.6.4 and lower the :command:`if` command implicitly
|
||||
@@ -22,7 +25,5 @@ for this policy is to recognize numbers and boolean constants without
|
||||
dereferencing variables with such names.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0013
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Duplicate binary directories are not allowed.
|
||||
|
||||
CMake 2.6.3 and below silently permitted add_subdirectory() calls to
|
||||
@@ -15,7 +18,5 @@ behavior for this policy is to disallow duplicate binary directories
|
||||
with an error.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
|
||||
.. |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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
CMP0014
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Input directories must have ``CMakeLists.txt``.
|
||||
|
||||
CMake versions before 2.8 silently ignored missing ``CMakeLists.txt``
|
||||
@@ -11,7 +14,5 @@ The ``OLD`` behavior for this policy is to silently ignore the problem.
|
||||
The ``NEW`` behavior for this policy is to report an error.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
|
||||
.. |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
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
This policy was introduced in CMake version |INTRODUCED_IN_CMAKE_VERSION|.
|
||||
Prior to removal in CMake version |REMOVED_IN_CMAKE_VERSION|, it could be
|
||||
set by :command:`cmake_policy` or :command:`cmake_minimum_required`.
|
||||
If it was not set, CMake |WARNED_OR_DID_NOT_WARN|, and used ``OLD`` behavior.
|
||||
@@ -0,0 +1,5 @@
|
||||
.. warning::
|
||||
The ``OLD`` behavior of this policy was removed
|
||||
in CMake version |REMOVED_IN_CMAKE_VERSION|.
|
||||
This policy must be set to ``NEW`` by a call to
|
||||
:command:`cmake_minimum_required` or :command:`cmake_policy`.
|
||||
@@ -0,0 +1,10 @@
|
||||
remove-old-compatibility
|
||||
------------------------
|
||||
|
||||
* Compatibility with versions of CMake older than 2.8.0 has been removed.
|
||||
Calls to :command:`cmake_minimum_required` or :command:`cmake_policy`
|
||||
that set the policy version to an older value now issue an error.
|
||||
Note that calls to those commands can still support older versions of
|
||||
CMake by using their ``VERSION`` arguments' ``<min>...<max>`` syntax.
|
||||
This requires only the ``<min>`` version of CMake, but when running a
|
||||
newer version, sets policies up to the ``<max>`` version.
|
||||
@@ -1,4 +1,4 @@
|
||||
CMAKE_BACKWARDS_COMPATIBILITY
|
||||
-----------------------------
|
||||
|
||||
Deprecated. See CMake Policy :policy:`CMP0001` documentation.
|
||||
Removed. See policy :policy:`CMP0001`.
|
||||
|
||||
@@ -60,9 +60,6 @@ endfunction()
|
||||
|
||||
# Get architectures of given SDK (iphonesimulator/iphoneos)
|
||||
function(_ios_install_combined_get_valid_archs sdk resultvar)
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
|
||||
if("${resultvar}" STREQUAL "")
|
||||
message(FATAL_ERROR "`resultvar` is empty")
|
||||
endif()
|
||||
@@ -77,8 +74,6 @@ function(_ios_install_combined_get_valid_archs sdk resultvar)
|
||||
_ios_install_combined_message("Architectures (${sdk}): ${printable}")
|
||||
|
||||
set("${resultvar}" "${valid_archs}" PARENT_SCOPE)
|
||||
|
||||
cmake_policy(POP)
|
||||
endfunction()
|
||||
|
||||
# Make both arch lists a disjoint set by preferring the current SDK
|
||||
|
||||
@@ -869,10 +869,7 @@ macro(_ExternalData_arg_series)
|
||||
endmacro()
|
||||
|
||||
function(_ExternalData_arg_find_files glob pattern regex)
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0009 NEW)
|
||||
file(${glob} globbed RELATIVE "${top_src}" "${top_src}/${pattern}*")
|
||||
cmake_policy(POP)
|
||||
set(externals_count -1)
|
||||
foreach(entry IN LISTS globbed)
|
||||
if("x${entry}" MATCHES "^x(.*)(\\.(${_ExternalData_REGEX_EXT}))$")
|
||||
|
||||
@@ -50,8 +50,6 @@
|
||||
# generated_cubin_file:STRING=<> File to generate. This argument must be passed
|
||||
# in if build_cubin is true.
|
||||
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
if(NOT generated_file)
|
||||
message(FATAL_ERROR "You must specify generated_file on the command line")
|
||||
endif()
|
||||
@@ -302,5 +300,3 @@ if( build_cubin )
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
cmake_policy(POP)
|
||||
|
||||
@@ -268,7 +268,6 @@ endfunction()
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
function(env_module_list out_var)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
env_module(COMMAND -t list OUTPUT_VARIABLE tmp_out)
|
||||
|
||||
# Convert output into a CMake list
|
||||
@@ -286,8 +285,6 @@ endfunction()
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
function(env_module_avail)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
|
||||
if(ARGC EQUAL 1)
|
||||
set(mod_prefix)
|
||||
set(out_var ${ARGV0})
|
||||
|
||||
@@ -44,7 +44,6 @@ locations other than lua/
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_policy(PUSH) # Policies apply to functions at definition-time
|
||||
cmake_policy(SET CMP0012 NEW) # For while(TRUE)
|
||||
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
|
||||
|
||||
unset(_lua_include_subdirs)
|
||||
|
||||
@@ -111,7 +111,6 @@ to know what include directories are needed.
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0012 NEW) # if() recognizes numbers and booleans
|
||||
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>
|
||||
|
||||
@@ -215,8 +215,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
|
||||
|
||||
|
||||
cmake_policy(PUSH)
|
||||
# numbers and boolean constants
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
# IN_LIST operator
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
|
||||
|
||||
@@ -623,8 +623,6 @@ If the library type is not specified, ``MODULE`` is assumed.
|
||||
|
||||
|
||||
cmake_policy(PUSH)
|
||||
# numbers and boolean constants
|
||||
cmake_policy (SET CMP0012 NEW)
|
||||
# foreach loop variable scope
|
||||
cmake_policy (SET CMP0124 NEW)
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
#
|
||||
|
||||
cmake_policy(PUSH)
|
||||
# list supports empty elements
|
||||
cmake_policy (SET CMP0007 NEW)
|
||||
# numbers and boolean constants
|
||||
cmake_policy (SET CMP0012 NEW)
|
||||
# IN_LIST operator
|
||||
cmake_policy (SET CMP0057 NEW)
|
||||
# foreach loop variable scope
|
||||
|
||||
@@ -195,9 +195,6 @@ if(FortranCInterface_SOURCE_DIR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Verify that C and Fortran are available.
|
||||
foreach(lang C Fortran)
|
||||
@@ -402,6 +399,3 @@ function(FortranCInterface_VERIFY)
|
||||
"The output was:\n ${_output}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Restore including context policies.
|
||||
cmake_policy(POP)
|
||||
|
||||
@@ -394,8 +394,6 @@ Deprecated Commands
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_policy(PUSH)
|
||||
# numbers and boolean constants
|
||||
cmake_policy (SET CMP0012 NEW)
|
||||
# IN_LIST operator
|
||||
cmake_policy (SET CMP0057 NEW)
|
||||
# Ninja generator normalizes custom command depfile paths
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
#include "cmExecutionStatus.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmPolicies.h"
|
||||
#include "cmState.h"
|
||||
#include "cmStateTypes.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmValue.h"
|
||||
|
||||
namespace {
|
||||
bool HandleSetMode(std::vector<std::string> const& args,
|
||||
@@ -88,20 +85,6 @@ bool HandleSetMode(std::vector<std::string> const& args,
|
||||
status.SetError("SET failed to set policy.");
|
||||
return false;
|
||||
}
|
||||
if (args[1] == "CMP0001" &&
|
||||
(policyStatus == cmPolicies::WARN || policyStatus == cmPolicies::OLD)) {
|
||||
if (!(status.GetMakefile().GetState()->GetInitializedCacheValue(
|
||||
"CMAKE_BACKWARDS_COMPATIBILITY"))) {
|
||||
// Set it to 2.4 because that is the last version where the
|
||||
// variable had meaning.
|
||||
status.GetMakefile().AddCacheDefinition(
|
||||
"CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
|
||||
"For backwards compatibility, what version of CMake "
|
||||
"commands and "
|
||||
"syntax should this version of CMake try to support.",
|
||||
cmStateEnums::STRING);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -671,11 +671,6 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target,
|
||||
|
||||
cmComputeLinkDepends::~cmComputeLinkDepends() = default;
|
||||
|
||||
void cmComputeLinkDepends::SetOldLinkDirMode(bool b)
|
||||
{
|
||||
this->OldLinkDirMode = b;
|
||||
}
|
||||
|
||||
std::vector<cmComputeLinkDepends::LinkEntry> const&
|
||||
cmComputeLinkDepends::Compute()
|
||||
{
|
||||
@@ -884,11 +879,6 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry qe)
|
||||
|
||||
// Handle dependent shared libraries.
|
||||
this->FollowSharedDeps(depender_index, iface);
|
||||
|
||||
// Support for CMP0003.
|
||||
for (cmLinkItem const& oi : iface->WrongConfigLibraries) {
|
||||
this->CheckWrongConfigItem(oi);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Follow the old-style dependency list.
|
||||
@@ -999,9 +989,6 @@ void cmComputeLinkDepends::AddVarLinkEntries(
|
||||
// If the library is meant for this link type then use it.
|
||||
if (llt == GENERAL_LibraryType || llt == this->LinkType) {
|
||||
actual_libs.emplace_back(this->ResolveLinkItem(depender_index, d));
|
||||
} else if (this->OldLinkDirMode) {
|
||||
cmLinkItem item = this->ResolveLinkItem(depender_index, d);
|
||||
this->CheckWrongConfigItem(item);
|
||||
}
|
||||
|
||||
// Reset the link type until another explicit type is given.
|
||||
@@ -1028,9 +1015,6 @@ void cmComputeLinkDepends::AddDirectLinkEntries()
|
||||
this->AddLinkEntries(cm::nullopt, runtimeEntries->second);
|
||||
}
|
||||
}
|
||||
for (cmLinkItem const& wi : impl->WrongConfigLibraries) {
|
||||
this->CheckWrongConfigItem(wi);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@@ -1736,17 +1720,3 @@ void cmComputeLinkDepends::DisplayFinalEntries()
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
void cmComputeLinkDepends::CheckWrongConfigItem(cmLinkItem const& item)
|
||||
{
|
||||
if (!this->OldLinkDirMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
// For CMake 2.4 bug-compatibility we need to consider the output
|
||||
// directories of targets linked in another configuration as link
|
||||
// directories.
|
||||
if (item.Target && !item.Target->IsImported()) {
|
||||
this->OldWrongConfigItems.insert(item.Target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,12 +85,6 @@ public:
|
||||
using EntryVector = std::vector<LinkEntry>;
|
||||
EntryVector const& Compute();
|
||||
|
||||
void SetOldLinkDirMode(bool b);
|
||||
std::set<cmGeneratorTarget const*> const& GetOldWrongConfigItems() const
|
||||
{
|
||||
return this->OldWrongConfigItems;
|
||||
}
|
||||
|
||||
private:
|
||||
// Context information.
|
||||
cmGeneratorTarget const* Target = nullptr;
|
||||
@@ -212,12 +206,9 @@ private:
|
||||
|
||||
// Record of the original link line.
|
||||
std::vector<size_t> OriginalEntries;
|
||||
std::set<cmGeneratorTarget const*> OldWrongConfigItems;
|
||||
void CheckWrongConfigItem(cmLinkItem const& item);
|
||||
|
||||
// Record of explicitly linked object files.
|
||||
std::vector<size_t> ObjectEntries;
|
||||
|
||||
size_t ComponentOrderId;
|
||||
bool OldLinkDirMode = false;
|
||||
};
|
||||
|
||||
@@ -422,25 +422,6 @@ cmComputeLinkInformation::cmComputeLinkInformation(
|
||||
this->OrderDependentRPath->AddLanguageDirectories(this->RuntimeLinkDirs);
|
||||
}
|
||||
|
||||
// Decide whether to enable compatible library search path mode.
|
||||
// There exists code that effectively does
|
||||
//
|
||||
// /path/to/libA.so -lB
|
||||
//
|
||||
// where -lB is meant to link to /path/to/libB.so. This is broken
|
||||
// because it specified -lB without specifying a link directory (-L)
|
||||
// in which to search for B. This worked in CMake 2.4 and below
|
||||
// because -L/path/to would be added by the -L/-l split for A. In
|
||||
// order to support such projects we need to add the directories
|
||||
// containing libraries linked with a full path to the -L path.
|
||||
this->OldLinkDirMode =
|
||||
this->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW;
|
||||
if (this->OldLinkDirMode) {
|
||||
// Construct a mask to not bother with this behavior for link
|
||||
// directories already specified by the user.
|
||||
this->OldLinkDirMask.insert(directories.begin(), directories.end());
|
||||
}
|
||||
|
||||
this->CMP0060Warn = this->Makefile->PolicyOptionalWarningEnabled(
|
||||
"CMAKE_POLICY_WARNING_CMP0060");
|
||||
}
|
||||
@@ -587,7 +568,6 @@ bool cmComputeLinkInformation::Compute()
|
||||
// Compute the ordered link line items.
|
||||
cmComputeLinkDepends cld(this->Target, this->Config, this->LinkLanguage,
|
||||
strategy);
|
||||
cld.SetOldLinkDirMode(this->OldLinkDirMode);
|
||||
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
|
||||
FeatureDescriptor const* currentFeature = nullptr;
|
||||
|
||||
@@ -667,27 +647,6 @@ bool cmComputeLinkInformation::Compute()
|
||||
this->SetCurrentLinkType(this->StartLinkType);
|
||||
}
|
||||
|
||||
// Finish listing compatibility paths.
|
||||
if (this->OldLinkDirMode) {
|
||||
// For CMake 2.4 bug-compatibility we need to consider the output
|
||||
// directories of targets linked in another configuration as link
|
||||
// directories.
|
||||
std::set<cmGeneratorTarget const*> const& wrongItems =
|
||||
cld.GetOldWrongConfigItems();
|
||||
for (cmGeneratorTarget const* tgt : wrongItems) {
|
||||
cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(this->Config)
|
||||
? cmStateEnums::ImportLibraryArtifact
|
||||
: cmStateEnums::RuntimeBinaryArtifact;
|
||||
this->OldLinkDirItems.push_back(
|
||||
tgt->GetFullPath(this->Config, artifact, true));
|
||||
}
|
||||
}
|
||||
|
||||
// Finish setting up linker search directories.
|
||||
if (!this->FinishLinkerSearchDirectories()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add implicit language runtime libraries and directories.
|
||||
this->AddImplicitLinkInfo();
|
||||
|
||||
@@ -1301,7 +1260,7 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry)
|
||||
}
|
||||
} else if (entry.Kind != cmComputeLinkDepends::LinkEntry::Object) {
|
||||
// This is a library or option specified by the user.
|
||||
this->AddUserItem(entry, true);
|
||||
this->AddUserItem(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1674,14 +1633,6 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry)
|
||||
return;
|
||||
}
|
||||
|
||||
// For compatibility with CMake 2.4 include the item's directory in
|
||||
// the linker search path.
|
||||
if (this->OldLinkDirMode && !target->IsFrameworkOnApple() &&
|
||||
!cm::contains(this->OldLinkDirMask,
|
||||
cmSystemTools::GetFilenamePath(item.Value))) {
|
||||
this->OldLinkDirItems.push_back(item.Value);
|
||||
}
|
||||
|
||||
const bool isImportedFrameworkFolderOnApple =
|
||||
target->IsImportedFrameworkFolderOnApple(this->Config);
|
||||
if (target->IsFrameworkOnApple() || isImportedFrameworkFolderOnApple) {
|
||||
@@ -1760,19 +1711,6 @@ void cmComputeLinkInformation::AddFullItem(LinkEntry const& entry)
|
||||
return;
|
||||
}
|
||||
|
||||
// Full path libraries should specify a valid library file name.
|
||||
// See documentation of CMP0008.
|
||||
std::string generator = this->GlobalGenerator->GetName();
|
||||
if (this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
|
||||
(generator.find("Visual Studio") != std::string::npos ||
|
||||
generator.find("Xcode") != std::string::npos)) {
|
||||
std::string file = cmSystemTools::GetFilenameName(item.Value);
|
||||
if (!this->ExtractAnyLibraryName.find(file)) {
|
||||
this->HandleBadFullItem(entry, file);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// This is called to handle a link item that is a full path.
|
||||
// If the target is not a static library make sure the link type is
|
||||
// shared. This is because dynamic-mode linking can handle both
|
||||
@@ -1790,14 +1728,6 @@ void cmComputeLinkInformation::AddFullItem(LinkEntry const& entry)
|
||||
}
|
||||
}
|
||||
|
||||
// For compatibility with CMake 2.4 include the item's directory in
|
||||
// the linker search path.
|
||||
if (this->OldLinkDirMode &&
|
||||
!cm::contains(this->OldLinkDirMask,
|
||||
cmSystemTools::GetFilenamePath(item.Value))) {
|
||||
this->OldLinkDirItems.push_back(item.Value);
|
||||
}
|
||||
|
||||
// Now add the full path to the library.
|
||||
this->Items.emplace_back(
|
||||
item, ItemIsPath::Yes, nullptr, entry.ObjectSource,
|
||||
@@ -1862,7 +1792,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(LinkEntry const& entry)
|
||||
// library for the architecture at link time.
|
||||
LinkEntry fileEntry{ entry };
|
||||
fileEntry.Item = file;
|
||||
this->AddUserItem(fileEntry, false);
|
||||
this->AddUserItem(fileEntry);
|
||||
|
||||
// Make sure the link directory ordering will find the library.
|
||||
this->OrderLinkerSearchPath->AddLinkLibrary(item.Value);
|
||||
@@ -1870,8 +1800,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(LinkEntry const& entry)
|
||||
return true;
|
||||
}
|
||||
|
||||
void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry,
|
||||
bool pathNotKnown)
|
||||
void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry)
|
||||
{
|
||||
// This is called to handle a link item that does not match a CMake
|
||||
// target and is not a full path. We check here if it looks like a
|
||||
@@ -1886,15 +1815,6 @@ void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry,
|
||||
|
||||
if (item.Value[0] == '-' || item.Value[0] == '$' || item.Value[0] == '`') {
|
||||
// Pass flags through untouched.
|
||||
// if this is a -l option then we might need to warn about
|
||||
// CMP0003 so put it in OldUserFlagItems, if it is not a -l
|
||||
// or -Wl,-l (-framework -pthread), then allow it without a
|
||||
// CMP0003 as -L will not affect those other linker flags
|
||||
if (cmHasLiteralPrefix(item.Value, "-l") ||
|
||||
cmHasLiteralPrefix(item.Value, "-Wl,-l")) {
|
||||
// This is a linker option provided by the user.
|
||||
this->OldUserFlagItems.push_back(item.Value);
|
||||
}
|
||||
|
||||
// Restore the target link type since this item does not specify
|
||||
// one.
|
||||
@@ -1964,11 +1884,6 @@ void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry,
|
||||
// Use just the library name so the linker will search.
|
||||
lib = this->ExtractAnyLibraryName.match(2);
|
||||
} else {
|
||||
// This is a name specified by the user.
|
||||
if (pathNotKnown) {
|
||||
this->OldUserFlagItems.push_back(item.Value);
|
||||
}
|
||||
|
||||
// We must ask the linker to search for a library with this name.
|
||||
// Restore the target link type since this item does not specify
|
||||
// one.
|
||||
@@ -2154,155 +2069,12 @@ void cmComputeLinkInformation::AddSharedLibNoSOName(LinkEntry const& entry)
|
||||
// path instead of just the name.
|
||||
LinkEntry fileEntry{ entry };
|
||||
fileEntry.Item = cmSystemTools::GetFilenameName(entry.Item.Value);
|
||||
this->AddUserItem(fileEntry, false);
|
||||
this->AddUserItem(fileEntry);
|
||||
|
||||
// Make sure the link directory ordering will find the library.
|
||||
this->OrderLinkerSearchPath->AddLinkLibrary(entry.Item.Value);
|
||||
}
|
||||
|
||||
void cmComputeLinkInformation::HandleBadFullItem(LinkEntry const& entry,
|
||||
std::string const& file)
|
||||
{
|
||||
std::string const& item = entry.Item.Value;
|
||||
// Do not depend on things that do not exist.
|
||||
auto i = std::find(this->Depends.begin(), this->Depends.end(), item);
|
||||
if (i != this->Depends.end()) {
|
||||
this->Depends.erase(i);
|
||||
}
|
||||
|
||||
// Tell the linker to search for the item and provide the proper
|
||||
// path for it. Do not contribute to any CMP0003 warning (do not
|
||||
// put in OldLinkDirItems or OldUserFlagItems).
|
||||
LinkEntry fileEntry{ entry };
|
||||
fileEntry.Item = file;
|
||||
this->AddUserItem(fileEntry, false);
|
||||
this->OrderLinkerSearchPath->AddLinkLibrary(item);
|
||||
|
||||
// Produce any needed message.
|
||||
switch (this->Target->GetPolicyStatusCMP0008()) {
|
||||
case cmPolicies::WARN: {
|
||||
// Print the warning at most once for this item.
|
||||
std::string wid = cmStrCat("CMP0008-WARNING-GIVEN-", item);
|
||||
if (!this->CMakeInstance->GetState()->GetGlobalPropertyAsBool(wid)) {
|
||||
this->CMakeInstance->GetState()->SetGlobalProperty(wid, "1");
|
||||
std::ostringstream w;
|
||||
/* clang-format off */
|
||||
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0008) << "\n"
|
||||
"Target \"" << this->Target->GetName() << "\" links to item\n"
|
||||
" " << item << "\n"
|
||||
"which is a full-path but not a valid library file name.";
|
||||
/* clang-format on */
|
||||
this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
|
||||
this->Target->GetBacktrace());
|
||||
}
|
||||
}
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD: // NOLINT(bugprone-branch-clone)
|
||||
// OLD behavior does not warn.
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior will not get here.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
|
||||
{
|
||||
// Support broken projects if necessary.
|
||||
if (this->OldLinkDirItems.empty() || this->OldUserFlagItems.empty() ||
|
||||
!this->OldLinkDirMode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Enforce policy constraints.
|
||||
switch (this->Target->GetPolicyStatusCMP0003()) {
|
||||
case cmPolicies::WARN:
|
||||
if (!this->CMakeInstance->GetState()->GetGlobalPropertyAsBool(
|
||||
"CMP0003-WARNING-GIVEN")) {
|
||||
this->CMakeInstance->GetState()->SetGlobalProperty(
|
||||
"CMP0003-WARNING-GIVEN", "1");
|
||||
std::ostringstream w;
|
||||
this->PrintLinkPolicyDiagnosis(w);
|
||||
this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
|
||||
this->Target->GetBacktrace());
|
||||
}
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to add the paths containing libraries with
|
||||
// known full paths as link directories.
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// Should never happen due to assignment of OldLinkDirMode
|
||||
return true;
|
||||
}
|
||||
|
||||
// Add the link directories for full path items.
|
||||
for (std::string const& i : this->OldLinkDirItems) {
|
||||
this->OrderLinkerSearchPath->AddLinkLibrary(i);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
|
||||
{
|
||||
// Tell the user what to do.
|
||||
/* clang-format off */
|
||||
os << "Policy CMP0003 should be set before this line. "
|
||||
"Add code such as\n"
|
||||
" if(COMMAND cmake_policy)\n"
|
||||
" cmake_policy(SET CMP0003 NEW)\n"
|
||||
" endif(COMMAND cmake_policy)\n"
|
||||
"as early as possible but after the most recent call to "
|
||||
"cmake_minimum_required or cmake_policy(VERSION). ";
|
||||
/* clang-format on */
|
||||
|
||||
// List the items that might need the old-style paths.
|
||||
os << "This warning appears because target \"" << this->Target->GetName()
|
||||
<< "\" links to some libraries for which the linker must search:\n";
|
||||
{
|
||||
// Format the list of unknown items to be as short as possible while
|
||||
// still fitting in the allowed width (a true solution would be the
|
||||
// bin packing problem if we were allowed to change the order).
|
||||
std::string::size_type max_size = 76;
|
||||
std::string line;
|
||||
const char* sep = " ";
|
||||
for (std::string const& i : this->OldUserFlagItems) {
|
||||
// If the addition of another item will exceed the limit then
|
||||
// output the current line and reset it. Note that the separator
|
||||
// is either " " or ", " which is always 2 characters.
|
||||
if (!line.empty() && (line.size() + i.size() + 2) > max_size) {
|
||||
os << line << '\n';
|
||||
sep = " ";
|
||||
line.clear();
|
||||
}
|
||||
line += sep;
|
||||
line += i;
|
||||
// Convert to the other separator.
|
||||
sep = ", ";
|
||||
}
|
||||
if (!line.empty()) {
|
||||
os << line << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// List the paths old behavior is adding.
|
||||
os << "and other libraries with known full path:\n";
|
||||
std::set<std::string> emitted;
|
||||
for (std::string const& i : this->OldLinkDirItems) {
|
||||
if (emitted.insert(cmSystemTools::GetFilenamePath(i)).second) {
|
||||
os << " " << i << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// Explain.
|
||||
os << "CMake is adding directories in the second list to the linker "
|
||||
"search path in case they are needed to find libraries from the "
|
||||
"first list (for backwards compatibility with CMake 2.4). "
|
||||
"Set policy CMP0003 to OLD or NEW to enable or disable this "
|
||||
"behavior explicitly. "
|
||||
"Run \"cmake --help-policy CMP0003\" for more information.";
|
||||
}
|
||||
|
||||
void cmComputeLinkInformation::LoadImplicitLinkInfo()
|
||||
{
|
||||
// Get platform-wide implicit directories.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
|
||||
#include <iosfwd>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
@@ -210,13 +209,12 @@ private:
|
||||
void AddTargetItem(LinkEntry const& entry);
|
||||
void AddFullItem(LinkEntry const& entry);
|
||||
bool CheckImplicitDirItem(LinkEntry const& entry);
|
||||
void AddUserItem(LinkEntry const& entry, bool pathNotKnown);
|
||||
void AddUserItem(LinkEntry const& entry);
|
||||
void AddFrameworkItem(LinkEntry const& entry);
|
||||
void AddXcFrameworkItem(LinkEntry const& entry);
|
||||
void DropDirectoryItem(BT<std::string> const& item);
|
||||
bool CheckSharedLibNoSOName(LinkEntry const& entry);
|
||||
void AddSharedLibNoSOName(LinkEntry const& entry);
|
||||
void HandleBadFullItem(LinkEntry const& entry, std::string const& file);
|
||||
|
||||
// Framework info.
|
||||
void ComputeFrameworkInfo();
|
||||
@@ -227,8 +225,6 @@ private:
|
||||
|
||||
// Linker search path computation.
|
||||
std::unique_ptr<cmOrderDirectories> OrderLinkerSearchPath;
|
||||
bool FinishLinkerSearchDirectories();
|
||||
void PrintLinkPolicyDiagnosis(std::ostream&);
|
||||
|
||||
void AddExternalObjectTargets();
|
||||
|
||||
@@ -243,17 +239,12 @@ private:
|
||||
// Additional paths configured by the runtime linker
|
||||
std::vector<std::string> RuntimeLinkDirs;
|
||||
|
||||
// Linker search path compatibility mode.
|
||||
std::set<std::string> OldLinkDirMask;
|
||||
std::vector<std::string> OldLinkDirItems;
|
||||
std::vector<std::string> OldUserFlagItems;
|
||||
std::set<std::string> CMP0060WarnItems;
|
||||
// Dependent library path computation.
|
||||
std::unique_ptr<cmOrderDirectories> OrderDependentRPath;
|
||||
// Runtime path computation.
|
||||
std::unique_ptr<cmOrderDirectories> OrderRuntimeSearchPath;
|
||||
|
||||
bool OldLinkDirMode;
|
||||
bool IsOpenBSD;
|
||||
bool LinkDependsNoShared;
|
||||
bool RuntimeUseChrpath;
|
||||
|
||||
@@ -219,7 +219,6 @@ cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
|
||||
cmListFileBacktrace bt)
|
||||
: Makefile(makefile)
|
||||
, Backtrace(std::move(bt))
|
||||
, Policy12Status(makefile.GetPolicyStatus(cmPolicies::CMP0012))
|
||||
, Policy54Status(makefile.GetPolicyStatus(cmPolicies::CMP0054))
|
||||
, Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057))
|
||||
, Policy64Status(makefile.GetPolicyStatus(cmPolicies::CMP0064))
|
||||
@@ -292,8 +291,7 @@ bool cmConditionEvaluator::IsTrue(
|
||||
return false;
|
||||
}
|
||||
|
||||
return this->GetBooleanValueWithAutoDereference(newArgs.front(), errorString,
|
||||
status, true);
|
||||
return this->GetBooleanValue(newArgs.front());
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
@@ -402,64 +400,6 @@ bool cmConditionEvaluator::GetBooleanValue(
|
||||
return !def.IsOff();
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Boolean value behavior from CMake 2.6.4 and below.
|
||||
bool cmConditionEvaluator::GetBooleanValueOld(
|
||||
cmExpandedCommandArgument const& arg, bool const one) const
|
||||
{
|
||||
if (one) {
|
||||
// Old IsTrue behavior for single argument.
|
||||
if (arg == "0") {
|
||||
return false;
|
||||
}
|
||||
if (arg == "1") {
|
||||
return true;
|
||||
}
|
||||
cmValue def = this->GetDefinitionIfUnquoted(arg);
|
||||
return !def.IsOff();
|
||||
}
|
||||
// Old GetVariableOrNumber behavior.
|
||||
cmValue def = this->GetDefinitionIfUnquoted(arg);
|
||||
if (!def && std::atoi(arg.GetValue().c_str())) {
|
||||
def = cmValue(arg.GetValue());
|
||||
}
|
||||
return !def.IsOff();
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// returns the resulting boolean value
|
||||
bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
|
||||
cmExpandedCommandArgument& newArg, std::string& errorString,
|
||||
MessageType& status, bool const oneArg) const
|
||||
{
|
||||
// Use the policy if it is set.
|
||||
if (this->Policy12Status == cmPolicies::NEW) {
|
||||
return this->GetBooleanValue(newArg);
|
||||
}
|
||||
if (this->Policy12Status == cmPolicies::OLD) {
|
||||
return this->GetBooleanValueOld(newArg, oneArg);
|
||||
}
|
||||
|
||||
// Check policy only if old and new results differ.
|
||||
const auto newResult = this->GetBooleanValue(newArg);
|
||||
const auto oldResult = this->GetBooleanValueOld(newArg, oneArg);
|
||||
if (newResult != oldResult) {
|
||||
switch (this->Policy12Status) {
|
||||
case cmPolicies::WARN:
|
||||
errorString = "An argument named \"" + newArg.GetValue() +
|
||||
"\" appears in a conditional statement. " +
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0012);
|
||||
status = MessageType::AUTHOR_WARNING;
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
return oldResult;
|
||||
case cmPolicies::NEW:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return newResult;
|
||||
}
|
||||
|
||||
template <int N>
|
||||
inline int cmConditionEvaluator::matchKeysImpl(
|
||||
const cmExpandedCommandArgument&)
|
||||
@@ -823,15 +763,13 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
|
||||
|
||||
//=========================================================================
|
||||
// level 3 handles NOT
|
||||
bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
|
||||
std::string& errorString,
|
||||
MessageType& status)
|
||||
bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs, std::string&,
|
||||
MessageType&)
|
||||
{
|
||||
for (auto args = newArgs.make2ArgsIterator(); args.next != newArgs.end();
|
||||
args.advance(newArgs)) {
|
||||
if (this->IsKeyword(keyNOT, *args.current)) {
|
||||
const auto rhs = this->GetBooleanValueWithAutoDereference(
|
||||
*args.next, errorString, status);
|
||||
const auto rhs = this->GetBooleanValue(*args.next);
|
||||
newArgs.ReduceOneArg(!rhs, args);
|
||||
}
|
||||
}
|
||||
@@ -840,9 +778,8 @@ bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
|
||||
|
||||
//=========================================================================
|
||||
// level 4 handles AND OR
|
||||
bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs,
|
||||
std::string& errorString,
|
||||
MessageType& status)
|
||||
bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs, std::string&,
|
||||
MessageType&)
|
||||
{
|
||||
for (auto args = newArgs.make3ArgsIterator(); args.nextnext != newArgs.end();
|
||||
args.advance(newArgs)) {
|
||||
@@ -850,10 +787,8 @@ bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs,
|
||||
int matchNo;
|
||||
|
||||
if ((matchNo = this->matchKeys(*args.next, keyAND, keyOR))) {
|
||||
const auto lhs = this->GetBooleanValueWithAutoDereference(
|
||||
*args.current, errorString, status);
|
||||
const auto rhs = this->GetBooleanValueWithAutoDereference(
|
||||
*args.nextnext, errorString, status);
|
||||
const auto lhs = this->GetBooleanValue(*args.current);
|
||||
const auto rhs = this->GetBooleanValue(*args.nextnext);
|
||||
// clang-format off
|
||||
const auto result =
|
||||
cmRt2CtSelector<
|
||||
|
||||
@@ -42,14 +42,6 @@ private:
|
||||
|
||||
bool GetBooleanValue(cmExpandedCommandArgument& arg) const;
|
||||
|
||||
bool GetBooleanValueOld(cmExpandedCommandArgument const& arg,
|
||||
bool one) const;
|
||||
|
||||
bool GetBooleanValueWithAutoDereference(cmExpandedCommandArgument& newArg,
|
||||
std::string& errorString,
|
||||
MessageType& status,
|
||||
bool oneArg = false) const;
|
||||
|
||||
template <int N>
|
||||
int matchKeysImpl(const cmExpandedCommandArgument&);
|
||||
|
||||
@@ -75,7 +67,6 @@ private:
|
||||
|
||||
cmMakefile& Makefile;
|
||||
cmListFileBacktrace Backtrace;
|
||||
cmPolicies::PolicyStatus Policy12Status;
|
||||
cmPolicies::PolicyStatus Policy54Status;
|
||||
cmPolicies::PolicyStatus Policy57Status;
|
||||
cmPolicies::PolicyStatus Policy64Status;
|
||||
|
||||
@@ -677,28 +677,14 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
|
||||
i++;
|
||||
cmsys::Glob g;
|
||||
g.SetRecurse(recurse);
|
||||
|
||||
bool explicitFollowSymlinks = false;
|
||||
cmPolicies::PolicyStatus policyStatus =
|
||||
status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0009);
|
||||
if (recurse) {
|
||||
switch (policyStatus) {
|
||||
case cmPolicies::NEW:
|
||||
g.RecurseThroughSymlinksOff();
|
||||
break;
|
||||
case cmPolicies::WARN:
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
g.RecurseThroughSymlinksOn();
|
||||
break;
|
||||
}
|
||||
g.RecurseThroughSymlinksOff();
|
||||
}
|
||||
|
||||
cmake* cm = status.GetMakefile().GetCMakeInstance();
|
||||
std::vector<std::string> files;
|
||||
bool configureDepends = false;
|
||||
bool warnConfigureLate = false;
|
||||
bool warnFollowedSymlinks = false;
|
||||
const cmake::WorkingMode workingMode = cm->GetWorkingMode();
|
||||
while (i != args.end()) {
|
||||
if (*i == "LIST_DIRECTORIES") {
|
||||
@@ -722,7 +708,6 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
|
||||
} else if (*i == "FOLLOW_SYMLINKS") {
|
||||
++i; // skip FOLLOW_SYMLINKS
|
||||
if (recurse) {
|
||||
explicitFollowSymlinks = true;
|
||||
g.RecurseThroughSymlinksOn();
|
||||
if (i == args.end()) {
|
||||
status.SetError(
|
||||
@@ -805,11 +790,6 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
|
||||
}
|
||||
}
|
||||
|
||||
if (recurse && !explicitFollowSymlinks &&
|
||||
g.GetFollowedSymlinkCount() != 0) {
|
||||
warnFollowedSymlinks = true;
|
||||
}
|
||||
|
||||
std::vector<std::string>& foundFiles = g.GetFiles();
|
||||
cm::append(files, foundFiles);
|
||||
|
||||
@@ -834,24 +814,6 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
|
||||
}
|
||||
}
|
||||
|
||||
switch (policyStatus) {
|
||||
case cmPolicies::NEW:
|
||||
// Correct behavior, yay!
|
||||
break;
|
||||
case cmPolicies::OLD:
|
||||
// Probably not really the expected behavior, but the author explicitly
|
||||
// asked for the old behavior... no warning.
|
||||
case cmPolicies::WARN:
|
||||
// Possibly unexpected old behavior *and* we actually traversed
|
||||
// symlinks without being explicitly asked to: warn the author.
|
||||
if (warnFollowedSymlinks) {
|
||||
status.GetMakefile().IssueMessage(
|
||||
MessageType::AUTHOR_WARNING,
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0009));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
std::sort(files.begin(), files.end());
|
||||
files.erase(std::unique(files.begin(), files.end()), files.end());
|
||||
status.GetMakefile().AddDefinition(variable, cmList::to_string(files));
|
||||
|
||||
@@ -2789,8 +2789,8 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
|
||||
this->VersionRangeMax);
|
||||
}
|
||||
|
||||
// Load the version check file. Pass NoPolicyScope because we do
|
||||
// our own policy push/pop independent of CMP0011.
|
||||
// Load the version check file.
|
||||
// Pass NoPolicyScope because we do our own policy push/pop.
|
||||
bool suitable = false;
|
||||
if (this->ReadListFile(version_file, NoPolicyScope)) {
|
||||
// Check the output variables.
|
||||
|
||||
@@ -4753,27 +4753,11 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
|
||||
}
|
||||
if (lib != item) {
|
||||
cmake* cm = this->LocalGenerator->GetCMakeInstance();
|
||||
switch (this->GetPolicyStatusCMP0004()) {
|
||||
case cmPolicies::WARN: {
|
||||
std::ostringstream w;
|
||||
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0004) << "\n"
|
||||
<< "Target \"" << this->GetName() << "\" links to item \"" << item
|
||||
<< "\" which has leading or trailing whitespace.";
|
||||
cm->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
|
||||
this->GetBacktrace());
|
||||
}
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
break;
|
||||
case cmPolicies::NEW: {
|
||||
std::ostringstream e;
|
||||
e << "Target \"" << this->GetName() << "\" links to item \"" << item
|
||||
<< "\" which has leading or trailing whitespace. "
|
||||
<< "This is now an error according to policy CMP0004.";
|
||||
cm->IssueMessage(MessageType::FATAL_ERROR, e.str(),
|
||||
this->GetBacktrace());
|
||||
} break;
|
||||
}
|
||||
std::ostringstream e;
|
||||
e << "Target \"" << this->GetName() << "\" links to item \"" << item
|
||||
<< "\" which has leading or trailing whitespace. "
|
||||
<< "This is now an error according to policy CMP0004.";
|
||||
cm->IssueMessage(MessageType::FATAL_ERROR, e.str(), this->GetBacktrace());
|
||||
}
|
||||
return lib;
|
||||
}
|
||||
|
||||
@@ -1238,7 +1238,6 @@ private:
|
||||
bool secondPass) const;
|
||||
void ComputeLinkInterface(const std::string& config,
|
||||
cmOptionalLinkInterface& iface,
|
||||
const cmGeneratorTarget* head,
|
||||
bool secondPass) const;
|
||||
cmLinkImplementation const* GetLinkImplementation(const std::string& config,
|
||||
UseTo usage,
|
||||
|
||||
@@ -676,7 +676,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
|
||||
if (!iface.AllDone) {
|
||||
iface.AllDone = true;
|
||||
if (iface.Exists) {
|
||||
this->ComputeLinkInterface(config, iface, head, secondPass);
|
||||
this->ComputeLinkInterface(config, iface, secondPass);
|
||||
this->ComputeLinkInterfaceRuntimeLibraries(config, iface);
|
||||
}
|
||||
}
|
||||
@@ -684,9 +684,9 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
|
||||
return iface.Exists ? &iface : nullptr;
|
||||
}
|
||||
|
||||
void cmGeneratorTarget::ComputeLinkInterface(
|
||||
const std::string& config, cmOptionalLinkInterface& iface,
|
||||
cmGeneratorTarget const* headTarget, bool secondPass) const
|
||||
void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
|
||||
cmOptionalLinkInterface& iface,
|
||||
bool secondPass) const
|
||||
{
|
||||
if (iface.Explicit) {
|
||||
if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
||||
@@ -721,11 +721,7 @@ void cmGeneratorTarget::ComputeLinkInterface(
|
||||
} else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN ||
|
||||
this->GetPolicyStatusCMP0022() == cmPolicies::OLD) {
|
||||
// The link implementation is the default link interface.
|
||||
cmLinkImplementationLibraries const* impl =
|
||||
this->GetLinkImplementationLibrariesInternal(config, headTarget,
|
||||
UseTo::Link);
|
||||
iface.ImplementationIsInterface = true;
|
||||
iface.WrongConfigLibraries = impl->WrongConfigLibraries;
|
||||
}
|
||||
|
||||
if (this->LinkLanguagePropagatesToDependents()) {
|
||||
@@ -1459,9 +1455,6 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
|
||||
if (name == this->GetName() || name.empty()) {
|
||||
continue;
|
||||
}
|
||||
// Support OLD behavior for CMP0003.
|
||||
impl.WrongConfigLibraries.push_back(
|
||||
this->ResolveLinkItem(BT<std::string>(name), linkFeature));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ bool cmGlobVerificationManager::SaveVerificationScript(const std::string& path,
|
||||
<< cmVersion::GetMajorVersion() << "."
|
||||
<< cmVersion::GetMinorVersion() << "\n";
|
||||
|
||||
verifyScriptFile << "cmake_policy(SET CMP0009 NEW)\n";
|
||||
|
||||
for (auto const& i : this->Cache) {
|
||||
CacheEntryKey k = std::get<0>(i);
|
||||
CacheEntryValue v = std::get<1>(i);
|
||||
|
||||
@@ -105,7 +105,6 @@ public:
|
||||
bool MakeFilesFullPath(const char* modeName, const std::string& basePath,
|
||||
const std::vector<std::string>& relFiles,
|
||||
std::vector<std::string>& absFiles);
|
||||
bool CheckCMP0006() const;
|
||||
|
||||
std::string GetDestination(const cmInstallCommandArguments* args,
|
||||
const std::string& varName,
|
||||
@@ -1017,13 +1016,6 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
|
||||
if (!bundleArgs.GetDestination().empty()) {
|
||||
bundleGenerator = CreateInstallTargetGenerator(
|
||||
target, bundleArgs, false, helper.Makefile->GetBacktrace());
|
||||
} else if (!runtimeArgs.GetDestination().empty()) {
|
||||
if (helper.CheckCMP0006()) {
|
||||
// For CMake 2.4 compatibility fallback to the RUNTIME
|
||||
// properties.
|
||||
bundleGenerator = CreateInstallTargetGenerator(
|
||||
target, runtimeArgs, false, helper.Makefile->GetBacktrace());
|
||||
}
|
||||
}
|
||||
if (!bundleGenerator) {
|
||||
status.SetError(cmStrCat("TARGETS given no BUNDLE DESTINATION for "
|
||||
@@ -2482,24 +2474,6 @@ bool Helper::MakeFilesFullPath(const char* modeName,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Helper::CheckCMP0006() const
|
||||
{
|
||||
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0006)) {
|
||||
case cmPolicies::WARN:
|
||||
this->Makefile->IssueMessage(
|
||||
MessageType::AUTHOR_WARNING,
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0006));
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to allow compatibility
|
||||
return true;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior is to disallow compatibility
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string Helper::GetDestination(const cmInstallCommandArguments* args,
|
||||
const std::string& varName,
|
||||
const std::string& guess) const
|
||||
|
||||
@@ -65,10 +65,6 @@ struct cmLinkImplementationLibraries
|
||||
// Object files linked directly in this configuration.
|
||||
std::vector<cmLinkItem> Objects;
|
||||
|
||||
// Libraries linked directly in other configurations.
|
||||
// Needed only for OLD behavior of CMP0003.
|
||||
std::vector<cmLinkItem> WrongConfigLibraries;
|
||||
|
||||
// Whether the list depends on a genex referencing the configuration.
|
||||
bool HadContextSensitiveCondition = false;
|
||||
};
|
||||
@@ -108,10 +104,6 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries
|
||||
// or more static libraries.
|
||||
unsigned int Multiplicity = 0;
|
||||
|
||||
// Libraries listed for other configurations.
|
||||
// Needed only for OLD behavior of CMP0003.
|
||||
std::vector<cmLinkItem> WrongConfigLibraries;
|
||||
|
||||
bool ImplementationIsInterface = false;
|
||||
|
||||
// Whether the list depends on a link language genex.
|
||||
|
||||
@@ -89,29 +89,6 @@ cm::optional<cmList> GetList(const std::string& var,
|
||||
if (!cm::contains(*list, std::string())) {
|
||||
return list;
|
||||
}
|
||||
// if we have empty elements we need to check policy CMP0007
|
||||
switch (makefile.GetPolicyStatus(cmPolicies::CMP0007)) {
|
||||
case cmPolicies::WARN: {
|
||||
// Default is to warn and use old behavior
|
||||
// OLD behavior is to allow compatibility, so recall
|
||||
// ExpandListArgument without the true which will remove
|
||||
// empty values
|
||||
list->assign(listString);
|
||||
std::string warn =
|
||||
cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0007),
|
||||
" List has value = [", listString, "].");
|
||||
makefile.IssueMessage(MessageType::AUTHOR_WARNING, warn);
|
||||
return list;
|
||||
}
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to allow compatibility, so recall
|
||||
// ExpandListArgument without the true which will remove
|
||||
// empty values
|
||||
list->assign(listString);
|
||||
return list;
|
||||
case cmPolicies::NEW:
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include "cmTarget.h"
|
||||
#include "cmTestGenerator.h"
|
||||
#include "cmValue.h"
|
||||
#include "cmVersion.h"
|
||||
#include "cmake.h"
|
||||
|
||||
#if defined(__HAIKU__)
|
||||
@@ -102,8 +101,6 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
|
||||
this->AliasTargets = makefile->GetAliasTargets();
|
||||
|
||||
this->EmitUniversalBinaryFlags = true;
|
||||
this->BackwardsCompatibility = 0;
|
||||
this->BackwardsCompatibilityFinal = false;
|
||||
|
||||
this->ComputeObjectMaxPath();
|
||||
|
||||
@@ -4327,15 +4324,12 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
|
||||
bool keptSourceExtension = true;
|
||||
if (!source.GetPropertyAsBool("KEEP_EXTENSION")) {
|
||||
// Decide whether this language wants to replace the source
|
||||
// extension with the object extension. For CMake 2.4
|
||||
// compatibility do this by default.
|
||||
bool replaceExt = this->NeedBackwardsCompatibility_2_4();
|
||||
if (!replaceExt) {
|
||||
std::string lang = source.GetLanguage();
|
||||
if (!lang.empty()) {
|
||||
replaceExt = this->Makefile->IsOn(
|
||||
cmStrCat("CMAKE_", lang, "_OUTPUT_EXTENSION_REPLACE"));
|
||||
}
|
||||
// extension with the object extension.
|
||||
bool replaceExt = false;
|
||||
std::string lang = source.GetLanguage();
|
||||
if (!lang.empty()) {
|
||||
replaceExt = this->Makefile->IsOn(
|
||||
cmStrCat("CMAKE_", lang, "_OUTPUT_EXTENSION_REPLACE"));
|
||||
}
|
||||
|
||||
// Remove the source extension if it is to be replaced.
|
||||
@@ -4400,58 +4394,6 @@ std::string cmLocalGenerator::GetTargetDirectory(
|
||||
return "";
|
||||
}
|
||||
|
||||
KWIML_INT_uint64_t cmLocalGenerator::GetBackwardsCompatibility()
|
||||
{
|
||||
// The computed version may change until the project is fully
|
||||
// configured.
|
||||
if (!this->BackwardsCompatibilityFinal) {
|
||||
unsigned int major = 0;
|
||||
unsigned int minor = 0;
|
||||
unsigned int patch = 0;
|
||||
if (cmValue value =
|
||||
this->Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY")) {
|
||||
switch (sscanf(value->c_str(), "%u.%u.%u", &major, &minor, &patch)) {
|
||||
case 2:
|
||||
patch = 0;
|
||||
break;
|
||||
case 1:
|
||||
minor = 0;
|
||||
patch = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
this->BackwardsCompatibility = CMake_VERSION_ENCODE(major, minor, patch);
|
||||
this->BackwardsCompatibilityFinal = true;
|
||||
}
|
||||
|
||||
return this->BackwardsCompatibility;
|
||||
}
|
||||
|
||||
bool cmLocalGenerator::NeedBackwardsCompatibility_2_4()
|
||||
{
|
||||
// Check the policy to decide whether to pay attention to this
|
||||
// variable.
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0001)) {
|
||||
case cmPolicies::WARN:
|
||||
// WARN is just OLD without warning because user code does not
|
||||
// always affect whether this check is done.
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// Old behavior is to check the variable.
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// New behavior is to ignore the variable.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compatibility is needed if CMAKE_BACKWARDS_COMPATIBILITY is set
|
||||
// equal to or lower than the given version.
|
||||
KWIML_INT_uint64_t actual_compat = this->GetBackwardsCompatibility();
|
||||
return (actual_compat && actual_compat <= CMake_VERSION_ENCODE(2, 4, 255));
|
||||
}
|
||||
|
||||
cmPolicies::PolicyStatus cmLocalGenerator::GetPolicyStatus(
|
||||
cmPolicies::PolicyID id) const
|
||||
{
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
#include <cm/optional>
|
||||
|
||||
#include <cm3p/kwiml/int.h>
|
||||
|
||||
#include "cmCustomCommandTypes.h"
|
||||
#include "cmGeneratorOptions.h"
|
||||
#include "cmGeneratorTarget.h"
|
||||
@@ -433,23 +431,6 @@ public:
|
||||
virtual std::string GetTargetDirectory(
|
||||
cmGeneratorTarget const* target) const;
|
||||
|
||||
/**
|
||||
* Get the level of backwards compatibility requested by the project
|
||||
* in this directory. This is the value of the CMake variable
|
||||
* CMAKE_BACKWARDS_COMPATIBILITY whose format is
|
||||
* "major.minor[.patch]". The returned integer is encoded as
|
||||
*
|
||||
* CMake_VERSION_ENCODE(major, minor, patch)
|
||||
*
|
||||
* and is monotonically increasing with the CMake version.
|
||||
*/
|
||||
KWIML_INT_uint64_t GetBackwardsCompatibility();
|
||||
|
||||
/**
|
||||
* Test whether compatibility is set to a given version or lower.
|
||||
*/
|
||||
bool NeedBackwardsCompatibility_2_4();
|
||||
|
||||
cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
|
||||
|
||||
cmake* GetCMakeInstance() const;
|
||||
@@ -617,9 +598,6 @@ protected:
|
||||
|
||||
bool EmitUniversalBinaryFlags;
|
||||
|
||||
KWIML_INT_uint64_t BackwardsCompatibility;
|
||||
bool BackwardsCompatibilityFinal;
|
||||
|
||||
private:
|
||||
/**
|
||||
* See LinearGetSourceFileWithOutput for background information
|
||||
|
||||
+21
-206
@@ -131,7 +131,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
|
||||
this->PushLoopBlockBarrier();
|
||||
|
||||
// By default the check is not done. It is enabled by
|
||||
// cmListFileCache in the top level if necessary.
|
||||
// cmMakefile::Configure in the top level if necessary.
|
||||
this->CheckCMP0000 = false;
|
||||
|
||||
#if !defined(CMAKE_BOOTSTRAP)
|
||||
@@ -601,9 +601,7 @@ public:
|
||||
private:
|
||||
cmMakefile* Makefile;
|
||||
bool NoPolicyScope;
|
||||
bool CheckCMP0011 = false;
|
||||
bool ReportError = true;
|
||||
void EnforceCMP0011();
|
||||
};
|
||||
|
||||
cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
||||
@@ -621,48 +619,15 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
||||
this->Makefile->GetState()->CreateIncludeFileSnapshot(
|
||||
this->Makefile->StateSnapshot, filenametoread);
|
||||
if (!this->NoPolicyScope) {
|
||||
// Check CMP0011 to determine the policy scope type.
|
||||
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0011)) {
|
||||
case cmPolicies::WARN:
|
||||
// We need to push a scope to detect whether the script sets
|
||||
// any policies that would affect the includer and therefore
|
||||
// requires a warning. We use a weak scope to simulate OLD
|
||||
// behavior by allowing policy changes to affect the includer.
|
||||
this->Makefile->PushPolicy(true);
|
||||
this->CheckCMP0011 = true;
|
||||
break;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to not push a scope at all.
|
||||
this->NoPolicyScope = true;
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior is to push a (strong) scope.
|
||||
this->Makefile->PushPolicy();
|
||||
break;
|
||||
}
|
||||
this->Makefile->PushPolicy();
|
||||
}
|
||||
}
|
||||
|
||||
cmMakefile::IncludeScope::~IncludeScope()
|
||||
{
|
||||
if (!this->NoPolicyScope) {
|
||||
// If we need to enforce policy CMP0011 then the top entry is the
|
||||
// one we pushed above. If the entry is empty, then the included
|
||||
// script did not set any policies that might affect the includer so
|
||||
// we do not need to enforce the policy.
|
||||
if (this->CheckCMP0011 &&
|
||||
!this->Makefile->StateSnapshot.HasDefinedPolicyCMP0011()) {
|
||||
this->CheckCMP0011 = false;
|
||||
}
|
||||
|
||||
// Pop the scope we pushed for the script.
|
||||
this->Makefile->PopPolicy();
|
||||
|
||||
// We enforce the policy after the script's policy stack entry has
|
||||
// been removed.
|
||||
if (this->CheckCMP0011) {
|
||||
this->EnforceCMP0011();
|
||||
}
|
||||
}
|
||||
this->Makefile->PopSnapshot(this->ReportError);
|
||||
|
||||
@@ -671,36 +636,6 @@ cmMakefile::IncludeScope::~IncludeScope()
|
||||
this->Makefile->Backtrace = this->Makefile->Backtrace.Pop();
|
||||
}
|
||||
|
||||
void cmMakefile::IncludeScope::EnforceCMP0011()
|
||||
{
|
||||
// We check the setting of this policy again because the included
|
||||
// script might actually set this policy for its includer.
|
||||
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0011)) {
|
||||
case cmPolicies::WARN:
|
||||
// Warn because the user did not set this policy.
|
||||
{
|
||||
auto e = cmStrCat(
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0011),
|
||||
"\n"
|
||||
"The included script\n"
|
||||
" ",
|
||||
this->Makefile->GetBacktrace().Top().FilePath,
|
||||
"\n"
|
||||
"affects policy settings. "
|
||||
"CMake is implying the NO_POLICY_SCOPE option for compatibility, "
|
||||
"so the effects are applied to the including context.");
|
||||
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, e);
|
||||
}
|
||||
break;
|
||||
case cmPolicies::OLD:
|
||||
case cmPolicies::NEW:
|
||||
// The script set this policy. We assume the purpose of the
|
||||
// script is to initialize policies for its includer, and since
|
||||
// the policy is now set for later scripts, we do not warn.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool cmMakefile::ReadDependentFile(const std::string& filename,
|
||||
bool noPolicyScope)
|
||||
{
|
||||
@@ -986,24 +921,9 @@ void cmMakefile::EnforceDirectoryLevelRules() const
|
||||
"support older CMake versions for this project. "
|
||||
"For more information run "
|
||||
"\"cmake --help-policy CMP0000\".");
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0000)) {
|
||||
case cmPolicies::WARN:
|
||||
// Warn because the user did not provide a minimum required
|
||||
// version.
|
||||
this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING, e,
|
||||
this->Backtrace);
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to use policy version 2.4 set in
|
||||
// cmListFileCache.
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior is to issue an error.
|
||||
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
|
||||
this->Backtrace);
|
||||
cmSystemTools::SetFatalErrorOccurred();
|
||||
break;
|
||||
}
|
||||
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
|
||||
this->Backtrace);
|
||||
cmSystemTools::SetFatalErrorOccurred();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1538,27 +1458,6 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Definitions with non-trivial values require a policy check.
|
||||
static cmsys::RegularExpression trivial(
|
||||
"^[-/]D[A-Za-z_][A-Za-z0-9_]*(=[A-Za-z0-9_.]+)?$");
|
||||
if (!trivial.find(def)) {
|
||||
// This definition has a non-trivial value.
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0005)) {
|
||||
case cmPolicies::WARN:
|
||||
this->IssueMessage(MessageType::AUTHOR_WARNING,
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0005));
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to not escape the value. We should not
|
||||
// convert the definition to use the property.
|
||||
return false;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior is to escape the value. Proceed to convert it
|
||||
// to an entry in the property.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the definition part after the flag.
|
||||
const char* define = def.c_str() + 2;
|
||||
|
||||
@@ -1845,7 +1744,7 @@ void cmMakefile::Configure()
|
||||
this->SetCheckCMP0000(true);
|
||||
|
||||
// Implicitly set the version for the user.
|
||||
cmPolicies::ApplyPolicyVersion(this, 2, 4, 0,
|
||||
cmPolicies::ApplyPolicyVersion(this, 2, 8, 0,
|
||||
cmPolicies::WarnCompat::Off);
|
||||
}
|
||||
}
|
||||
@@ -1912,29 +1811,10 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
|
||||
std::string currentStartFile =
|
||||
this->GetCMakeInstance()->GetCMakeListFile(currentStart);
|
||||
if (!cmSystemTools::FileExists(currentStartFile, true)) {
|
||||
// The file is missing. Check policy CMP0014.
|
||||
auto e = cmStrCat("The source directory\n ", currentStart,
|
||||
"\n"
|
||||
"does not contain a CMakeLists.txt file.");
|
||||
/* clang-format on */
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0014)) {
|
||||
case cmPolicies::WARN:
|
||||
// Print the warning.
|
||||
e += cmStrCat("\n"
|
||||
"CMake does not support this case but it used "
|
||||
"to work accidentally and is being allowed for "
|
||||
"compatibility.\n",
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0014));
|
||||
this->IssueMessage(MessageType::AUTHOR_WARNING, e);
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior does not warn.
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior prints the error.
|
||||
this->IssueMessage(MessageType::FATAL_ERROR, e);
|
||||
break;
|
||||
}
|
||||
this->IssueMessage(MessageType::FATAL_ERROR,
|
||||
cmStrCat("The source directory\n ", currentStart,
|
||||
"\n"
|
||||
"does not contain a CMakeLists.txt file."));
|
||||
return;
|
||||
}
|
||||
// finally configure the subdir
|
||||
@@ -2916,30 +2796,7 @@ MessageType cmMakefile::ExpandVariablesInStringOld(
|
||||
error += cmStrCat("at\n ", filename, ':', line, '\n');
|
||||
}
|
||||
error += cmStrCat("when parsing string\n ", source, '\n', emsg);
|
||||
|
||||
// If the parser failed ("res" is false) then this is a real
|
||||
// argument parsing error, so the policy applies. Otherwise the
|
||||
// parser reported an error message without failing because the
|
||||
// helper implementation is unhappy, which has always reported an
|
||||
// error.
|
||||
mtype = MessageType::FATAL_ERROR;
|
||||
if (!res) {
|
||||
// This is a real argument parsing error. Use policy CMP0010 to
|
||||
// decide whether it is an error.
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0010)) {
|
||||
case cmPolicies::WARN:
|
||||
error +=
|
||||
cmStrCat('\n', cmPolicies::GetPolicyWarning(cmPolicies::CMP0010));
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to just warn and continue.
|
||||
mtype = MessageType::AUTHOR_WARNING;
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior is to report the error.
|
||||
break;
|
||||
}
|
||||
}
|
||||
errorstr = std::move(error);
|
||||
}
|
||||
return mtype;
|
||||
@@ -3272,9 +3129,6 @@ MessageType cmMakefile::ExpandVariablesInStringNew(
|
||||
|
||||
// Check for open variable references yet.
|
||||
if (!error && !openstack.empty()) {
|
||||
// There's an open variable reference waiting. Policy CMP0010 flags
|
||||
// whether this is an error or not. The new parser now enforces
|
||||
// CMP0010 as well.
|
||||
errorstr += "There is an unterminated variable reference.";
|
||||
error = true;
|
||||
}
|
||||
@@ -4411,17 +4265,6 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
|
||||
"\" because an imported target with the same name already exists.");
|
||||
return false;
|
||||
}
|
||||
// target names must be globally unique
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0002)) {
|
||||
case cmPolicies::WARN:
|
||||
this->IssueMessage(MessageType::AUTHOR_WARNING,
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
return true;
|
||||
case cmPolicies::NEW:
|
||||
break;
|
||||
}
|
||||
|
||||
// The conflict is with a non-imported target.
|
||||
// Allow this if the user has requested support.
|
||||
@@ -4479,45 +4322,17 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
|
||||
if (gg->BinaryDirectoryIsNew(binPath)) {
|
||||
return true;
|
||||
}
|
||||
std::string e;
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0013)) {
|
||||
case cmPolicies::WARN:
|
||||
// Print the warning.
|
||||
e = cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0013),
|
||||
"\n"
|
||||
"The binary directory\n"
|
||||
" ",
|
||||
binPath,
|
||||
"\n"
|
||||
"is already used to build a source directory. "
|
||||
"This command uses it to build source directory\n"
|
||||
" ",
|
||||
srcPath,
|
||||
"\n"
|
||||
"which can generate conflicting build files. "
|
||||
"CMake does not support this use case but it used "
|
||||
"to work accidentally and is being allowed for "
|
||||
"compatibility.");
|
||||
this->IssueMessage(MessageType::AUTHOR_WARNING, e);
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior does not warn.
|
||||
return true;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior prints the error.
|
||||
e += cmStrCat("The binary directory\n"
|
||||
" ",
|
||||
binPath,
|
||||
"\n"
|
||||
"is already used to build a source directory. "
|
||||
"It cannot be used to build source directory\n"
|
||||
" ",
|
||||
srcPath,
|
||||
"\n"
|
||||
"Specify a unique binary directory name.");
|
||||
this->IssueMessage(MessageType::FATAL_ERROR, e);
|
||||
break;
|
||||
}
|
||||
this->IssueMessage(MessageType::FATAL_ERROR,
|
||||
cmStrCat("The binary directory\n"
|
||||
" ",
|
||||
binPath,
|
||||
"\n"
|
||||
"is already used to build a source directory. "
|
||||
"It cannot be used to build source directory\n"
|
||||
" ",
|
||||
srcPath,
|
||||
"\n"
|
||||
"Specify a unique binary directory name."));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+16
-21
@@ -12,12 +12,9 @@
|
||||
#include "cmListFileCache.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmMessageType.h"
|
||||
#include "cmState.h"
|
||||
#include "cmStateSnapshot.h"
|
||||
#include "cmStateTypes.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmValue.h"
|
||||
#include "cmVersion.h"
|
||||
|
||||
static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
|
||||
@@ -297,12 +294,24 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer,
|
||||
unsigned int patchVer,
|
||||
WarnCompat warnCompat)
|
||||
{
|
||||
// Warn about policy versions for which support will be removed.
|
||||
if (warnCompat == WarnCompat::On &&
|
||||
(majorVer < 3 || (majorVer == 3 && minorVer < 10)) &&
|
||||
// Error on policy versions for which support has been removed.
|
||||
if (majorVer < 2 || (majorVer == 2 && minorVer < 8)) {
|
||||
if (IsFromLegacyInstallEXPORT(mf, majorVer, minorVer, patchVer)) {
|
||||
// Silently tolerate cmake_policy calls generated by install(EXPORT)
|
||||
// in CMake versions prior to 3.18.
|
||||
!IsFromLegacyInstallEXPORT(mf, majorVer, minorVer, patchVer)) {
|
||||
majorVer = 2;
|
||||
minorVer = 8;
|
||||
patchVer = 0;
|
||||
} else {
|
||||
mf->IssueMessage(MessageType::FATAL_ERROR,
|
||||
"Compatibility with CMake < 2.8.0 has been removed "
|
||||
"from CMake.\n" ADVICE_UPDATE_VERSION_ARGUMENT);
|
||||
cmSystemTools::SetFatalErrorOccurred();
|
||||
return false;
|
||||
}
|
||||
} else if ((majorVer < 3 || (majorVer == 3 && minorVer < 10)) &&
|
||||
warnCompat == WarnCompat::On) {
|
||||
// Warn about policy versions for which support will be removed.
|
||||
mf->IssueMessage(
|
||||
MessageType::DEPRECATION_WARNING,
|
||||
"Compatibility with CMake < 3.10 will be removed from "
|
||||
@@ -322,20 +331,6 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer,
|
||||
!mf->SetPolicy(pid, status)) {
|
||||
return false;
|
||||
}
|
||||
if (pid == cmPolicies::CMP0001 &&
|
||||
(status == cmPolicies::WARN || status == cmPolicies::OLD)) {
|
||||
if (!(mf->GetState()->GetInitializedCacheValue(
|
||||
"CMAKE_BACKWARDS_COMPATIBILITY"))) {
|
||||
// Set it to 2.4 because that is the last version where the
|
||||
// variable had meaning.
|
||||
mf->AddCacheDefinition(
|
||||
"CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
|
||||
"For backwards compatibility, what version of CMake "
|
||||
"commands and "
|
||||
"syntax should this version of CMake try to support.",
|
||||
cmStateEnums::STRING);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!mf->SetPolicy(pid, cmPolicies::NEW)) {
|
||||
|
||||
+15
-16
@@ -15,46 +15,45 @@ class cmMakefile;
|
||||
|
||||
#define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT) \
|
||||
SELECT(POLICY, CMP0000, \
|
||||
"A minimum required CMake version must be specified.", 2, 6, 0, \
|
||||
WARN) \
|
||||
"A minimum required CMake version must be specified.", 2, 6, 0, NEW) \
|
||||
SELECT(POLICY, CMP0001, \
|
||||
"CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", 2, 6, 0, \
|
||||
WARN) \
|
||||
NEW) \
|
||||
SELECT(POLICY, CMP0002, "Logical target names must be globally unique.", 2, \
|
||||
6, 0, WARN) \
|
||||
6, 0, NEW) \
|
||||
SELECT( \
|
||||
POLICY, CMP0003, \
|
||||
"Libraries linked via full path no longer produce linker search paths.", \
|
||||
2, 6, 0, WARN) \
|
||||
2, 6, 0, NEW) \
|
||||
SELECT(POLICY, CMP0004, \
|
||||
"Libraries linked may not have leading or trailing whitespace.", 2, \
|
||||
6, 0, WARN) \
|
||||
6, 0, NEW) \
|
||||
SELECT(POLICY, CMP0005, \
|
||||
"Preprocessor definition values are now escaped automatically.", 2, \
|
||||
6, 0, WARN) \
|
||||
6, 0, NEW) \
|
||||
SELECT(POLICY, CMP0006, \
|
||||
"Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.", \
|
||||
2, 6, 0, WARN) \
|
||||
2, 6, 0, NEW) \
|
||||
SELECT(POLICY, CMP0007, "list command no longer ignores empty elements.", \
|
||||
2, 6, 0, WARN) \
|
||||
2, 6, 0, NEW) \
|
||||
SELECT( \
|
||||
POLICY, CMP0008, \
|
||||
"Libraries linked by full-path must have a valid library file name.", 2, \
|
||||
6, 1, WARN) \
|
||||
6, 1, NEW) \
|
||||
SELECT(POLICY, CMP0009, \
|
||||
"FILE GLOB_RECURSE calls should not follow symlinks by default.", 2, \
|
||||
6, 2, WARN) \
|
||||
6, 2, NEW) \
|
||||
SELECT(POLICY, CMP0010, "Bad variable reference syntax is an error.", 2, 6, \
|
||||
3, WARN) \
|
||||
3, NEW) \
|
||||
SELECT(POLICY, CMP0011, \
|
||||
"Included scripts do automatic cmake_policy PUSH and POP.", 2, 6, 3, \
|
||||
WARN) \
|
||||
NEW) \
|
||||
SELECT(POLICY, CMP0012, "if() recognizes numbers and boolean constants.", \
|
||||
2, 8, 0, WARN) \
|
||||
2, 8, 0, NEW) \
|
||||
SELECT(POLICY, CMP0013, "Duplicate binary directories are not allowed.", 2, \
|
||||
8, 0, WARN) \
|
||||
8, 0, NEW) \
|
||||
SELECT(POLICY, CMP0014, "Input directories must have CMakeLists.txt.", 2, \
|
||||
8, 0, WARN) \
|
||||
8, 0, NEW) \
|
||||
SELECT(POLICY, CMP0015, \
|
||||
"link_directories() treats paths relative to the source dir.", 2, 8, \
|
||||
1, WARN) \
|
||||
|
||||
@@ -200,11 +200,6 @@ cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(cmPolicies::PolicyID id,
|
||||
return status;
|
||||
}
|
||||
|
||||
bool cmStateSnapshot::HasDefinedPolicyCMP0011()
|
||||
{
|
||||
return !this->Position->Policies->IsEmpty();
|
||||
}
|
||||
|
||||
cmValue cmStateSnapshot::GetDefinition(std::string const& name) const
|
||||
{
|
||||
assert(this->Position->Vars.IsValid());
|
||||
|
||||
@@ -46,7 +46,6 @@ public:
|
||||
void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
|
||||
cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id,
|
||||
bool parent_scope = false) const;
|
||||
bool HasDefinedPolicyCMP0011();
|
||||
void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak);
|
||||
bool PopPolicy();
|
||||
bool CanPopPolicyScope();
|
||||
|
||||
@@ -2650,27 +2650,6 @@ int cmake::ActualConfigure()
|
||||
// if the project did not define one of the entries below, add them now
|
||||
// so users can edit the values in the cache:
|
||||
|
||||
// We used to always present LIBRARY_OUTPUT_PATH and
|
||||
// EXECUTABLE_OUTPUT_PATH. They are now documented as old-style and
|
||||
// should no longer be used. Therefore we present them only if the
|
||||
// project requires compatibility with CMake 2.4. We detect this
|
||||
// here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY
|
||||
// variable created when CMP0001 is not set to NEW.
|
||||
if (this->State->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) {
|
||||
if (!this->State->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) {
|
||||
this->AddCacheEntry(
|
||||
"LIBRARY_OUTPUT_PATH", "",
|
||||
"Single output directory for building all libraries.",
|
||||
cmStateEnums::PATH);
|
||||
}
|
||||
if (!this->State->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) {
|
||||
this->AddCacheEntry(
|
||||
"EXECUTABLE_OUTPUT_PATH", "",
|
||||
"Single output directory for building all executables.",
|
||||
cmStateEnums::PATH);
|
||||
}
|
||||
}
|
||||
|
||||
const auto& mf = this->GlobalGenerator->GetMakefiles()[0];
|
||||
|
||||
if (mf->IsOn("CTEST_USE_LAUNCHERS") &&
|
||||
|
||||
@@ -545,9 +545,6 @@ if(BUILD_TESTING)
|
||||
ADD_TEST_MACRO(CrossCompile CrossCompile)
|
||||
set_tests_properties(CrossCompile PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "try_run.. invoked in cross-compiling mode")
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Make")
|
||||
ADD_TEST_MACRO(Policy0002 Policy0002)
|
||||
endif()
|
||||
if(CMake_TEST_XCODE_VERSION)
|
||||
set(Architecture_BUILD_OPTIONS -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION})
|
||||
ADD_TEST_MACRO(Architecture Architecture)
|
||||
|
||||
@@ -40,60 +40,6 @@ macro(test_vars _old)
|
||||
endmacro()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Test the OLD behavior of CMP0012.
|
||||
cmake_policy(SET CMP0012 OLD)
|
||||
|
||||
# False constants not recognized (still false).
|
||||
foreach(_false "" ${FALSE_NAMES})
|
||||
if("${_false}")
|
||||
message(FATAL_ERROR "OLD if(${_false}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(${_false}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT "${_false}")
|
||||
message(STATUS "OLD if(NOT ${_false}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "OLD if(NOT ${_false}) is false!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# True constants not recognized.
|
||||
foreach(_false ${TRUE_NAMES})
|
||||
if(${_false})
|
||||
message(FATAL_ERROR "OLD if(${_false}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(${_false}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT ${_false})
|
||||
message(STATUS "OLD if(NOT ${_false}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "OLD if(NOT ${_false}) is false!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Numbers not recognized properly.
|
||||
foreach(_num 2 -2 2.0 -2.0 2x -2x)
|
||||
if(${_num})
|
||||
message(FATAL_ERROR "OLD if(${_num}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(${_num}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT ${_num})
|
||||
message(FATAL_ERROR "OLD if(NOT ${_num}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(NOT ${_num}) is false")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
test_vars("OLD ")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Test the NEW behavior of CMP0012.
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
|
||||
# Test false constants.
|
||||
foreach(_false "" 0 ${FALSE_NAMES})
|
||||
|
||||
@@ -152,33 +152,10 @@ foreach(cmd IN ITEMS Find Get Insert Length Remove_At)
|
||||
check_cmake_test_single(List "${cmd}-List-Only" "${_test_file_name}")
|
||||
endforeach()
|
||||
|
||||
set(thelist "" NEW OLD)
|
||||
|
||||
foreach (_pol ${thelist})
|
||||
cmake_policy(SET CMP0007 ${_pol})
|
||||
list(GET thelist 1 thevalue)
|
||||
if (NOT thevalue STREQUAL _pol)
|
||||
message(SEND_ERROR "returned element '${thevalue}', but expected '${_pol}'")
|
||||
endif()
|
||||
endforeach (_pol)
|
||||
|
||||
block(SCOPE_FOR POLICIES)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
set(result andy bill brad ken bob)
|
||||
list(INSERT result 1 "")
|
||||
TEST("INSERT result 1 \"\"" "andy;;bill;brad;ken;bob")
|
||||
list(INSERT result 4 ";")
|
||||
TEST("INSERT result 1 ;" "andy;;bill;brad;;;ken;bob")
|
||||
list(INSERT result 0 "x")
|
||||
TEST("INSERT result 1 x" "x;andy;;bill;brad;;;ken;bob")
|
||||
endblock()
|
||||
block(SCOPE_FOR POLICIES)
|
||||
cmake_policy(SET CMP0007 OLD)
|
||||
set(result andy bill brad ken bob)
|
||||
list(INSERT result 1 "")
|
||||
TEST("INSERT result 1 \"\"" "andy;;bill;brad;ken;bob")
|
||||
list(INSERT result 4 ";")
|
||||
TEST("INSERT result 1 ;" "andy;bill;brad;ken;;;bob")
|
||||
list(INSERT result 0 "x")
|
||||
TEST("INSERT result 1 x" "x;andy;bill;brad;ken;bob")
|
||||
endblock()
|
||||
set(result andy bill brad ken bob)
|
||||
list(INSERT result 1 "")
|
||||
TEST("INSERT result 1 \"\"" "andy;;bill;brad;ken;bob")
|
||||
list(INSERT result 4 ";")
|
||||
TEST("INSERT result 1 ;" "andy;;bill;brad;;;ken;bob")
|
||||
list(INSERT result 0 "x")
|
||||
TEST("INSERT result 1 x" "x;andy;;bill;brad;;;ken;bob")
|
||||
|
||||
@@ -19,16 +19,6 @@ function(message)
|
||||
endfunction()
|
||||
message("message")
|
||||
|
||||
# Try setting a new policy. The IF test is for coverage.
|
||||
if(POLICY CMP0003)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
|
||||
cmake_policy(GET CMP0003 P3)
|
||||
if(NOT "${P3}" STREQUAL "NEW")
|
||||
message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# It is not recommended to set a policy to OLD, but this test
|
||||
# covers the OLD behavior of some policies.
|
||||
foreach(p
|
||||
|
||||
@@ -12,16 +12,6 @@ string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -DCOMPLEX_NDEBUG")
|
||||
string(APPEND CMAKE_C_FLAGS_MINSIZEREL " -DCOMPLEX_NDEBUG")
|
||||
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " -DCOMPLEX_NDEBUG")
|
||||
|
||||
# Try setting a new policy. The IF test is for coverage.
|
||||
if(POLICY CMP0003)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
|
||||
cmake_policy(GET CMP0003 P3)
|
||||
if(NOT "${P3}" STREQUAL "NEW")
|
||||
message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# It is not recommended to set a policy to OLD, but this test
|
||||
# covers the OLD behavior of some policies.
|
||||
foreach(p
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
add_executable(Policy0002 ../policy0002.c)
|
||||
@@ -1,5 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Policy0002 C)
|
||||
cmake_policy(SET CMP0002 OLD)
|
||||
add_subdirectory(A)
|
||||
add_executable(Policy0002 policy0002.c)
|
||||
@@ -1,4 +0,0 @@
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -3,6 +3,3 @@ cmake_minimum_required(VERSION 3.31)
|
||||
# Make sure a policy set differently by our includer is now correct.
|
||||
cmake_policy(GET CMP0180 cmp)
|
||||
check(CMP0180 "NEW" "${cmp}")
|
||||
|
||||
# Test allowing the top-level file to not have cmake_minimum_required.
|
||||
cmake_policy(SET CMP0000 OLD)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.30)
|
||||
project(PolicyScope C)
|
||||
# No cmake_minimum_required(VERSION), it's in FindFoo.
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Helper function to report results.
|
||||
@@ -10,28 +10,13 @@ function(check msg lhs rhs)
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Test using a development framework that sets policies for us.
|
||||
|
||||
cmake_policy(SET CMP0011 OLD)
|
||||
|
||||
# Put the test modules in the search path.
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# The included file should set policies for us.
|
||||
find_package(Foo)
|
||||
|
||||
# Check policies set by the package.
|
||||
cmake_policy(GET CMP0180 cmp)
|
||||
check(CMP0180 "OLD" "${cmp}")
|
||||
cmake_policy(GET CMP0179 cmp)
|
||||
check(CMP0179 "NEW" "${cmp}")
|
||||
cmake_policy(GET CMP0011 cmp)
|
||||
check(CMP0011 "NEW" "${cmp}")
|
||||
|
||||
# Make sure an included file cannot change policies.
|
||||
include(Bar)
|
||||
cmake_policy(GET CMP0180 cmp)
|
||||
check(CMP0180 "OLD" "${cmp}")
|
||||
check(CMP0180 "" "${cmp}")
|
||||
|
||||
# Allow the included file to change policies.
|
||||
include(Bar NO_POLICY_SCOPE)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.31)
|
||||
cmake_policy(SET CMP0180 OLD)
|
||||
@@ -25,7 +25,6 @@ set (GENERATE_CONTENT "if (\"${CMAKE_TAPI}\")
|
||||
endif()\n\n")
|
||||
|
||||
string (APPEND GENERATE_CONTENT [[
|
||||
cmake_policy (SET CMP0011 NEW)
|
||||
cmake_policy (SET CMP0057 NEW)
|
||||
|
||||
macro (CHECK_FILE test_msg path)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Target "bat" links to item " bar " which has leading or trailing
|
||||
whitespace. This is now an error according to policy CMP0004.
|
||||
@@ -1,18 +0,0 @@
|
||||
cmake_policy(SET CMP0004 OLD)
|
||||
|
||||
add_library(foo SHARED empty.cpp)
|
||||
add_library(bar SHARED empty.cpp)
|
||||
add_library(bing SHARED empty.cpp)
|
||||
add_library(bung SHARED empty.cpp)
|
||||
|
||||
cmake_policy(SET CMP0004 NEW)
|
||||
|
||||
add_library(bat SHARED empty.cpp)
|
||||
|
||||
target_link_libraries(foo "$<1: bar >")
|
||||
target_link_libraries(bing "$<$<NOT:$<TARGET_POLICY:CMP0004>>: bar >")
|
||||
target_link_libraries(bung "$<$<TARGET_POLICY:CMP0004>: bar >")
|
||||
|
||||
# The line below causes the error because the policy is NEW when bat
|
||||
# is created.
|
||||
target_link_libraries(bat "$<1: bar >")
|
||||
@@ -1,5 +1,4 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(CMP0004-OLD)
|
||||
run_cmake(CMP0004-NEW)
|
||||
run_cmake(CMP0004-policy-genex)
|
||||
|
||||
@@ -70,12 +70,7 @@ function(getMissingShlibsErrorExtra FILE RESULT_VAR)
|
||||
if(err_)
|
||||
set(error_extra " Extra: Could not unpack package content: '${err}'")
|
||||
else()
|
||||
cmake_policy(PUSH)
|
||||
# Tell file(GLOB_RECURSE) not to follow directory symlinks
|
||||
# even if the project does not set this policy to NEW.
|
||||
cmake_policy(SET CMP0009 NEW)
|
||||
file(GLOB_RECURSE FILE_PATHS_ LIST_DIRECTORIES false "${CMAKE_CURRENT_BINARY_DIR}/data_${PREFIX}/*")
|
||||
cmake_policy(POP)
|
||||
file(GLOB_RECURSE FILE_PATHS_ LIST_DIRECTORIES false "${CMAKE_CURRENT_BINARY_DIR}/data_${PREFIX}/*")
|
||||
|
||||
# get file info so that we can determine if file is executable or not
|
||||
foreach(FILE_ IN LISTS FILE_PATHS_)
|
||||
|
||||
@@ -46,52 +46,23 @@ if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
block(SCOPE_FOR POLICIES)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
set(listvar "0;1;2;3;4")
|
||||
list(INSERT listvar 1 "")
|
||||
set (output "$<LIST:INSERT,0;1;2;3;4,1,>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
set(listvar "0;1;2;3;4")
|
||||
list(INSERT listvar 1 "")
|
||||
set (output "$<LIST:INSERT,0;1;2;3;4,1,>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
list(INSERT listvar 4 ";")
|
||||
set (output "$<LIST:INSERT,0;;1;2;3;4,4,;>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
list(INSERT listvar 4 ";")
|
||||
set (output "$<LIST:INSERT,0;;1;2;3;4,4,;>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
list(INSERT listvar 0 "x")
|
||||
set (output "$<LIST:INSERT,0;;1;2;;;3;4,0,x>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
endblock()
|
||||
block(SCOPE_FOR POLICIES)
|
||||
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "")
|
||||
cmake_policy(SET CMP0007 OLD)
|
||||
|
||||
set(listvar "0;1;2;3;4")
|
||||
list(INSERT listvar 1 "")
|
||||
set (output "$<LIST:INSERT,0;1;2;3;4,1,>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
list(INSERT listvar 4 ";")
|
||||
set (output "$<LIST:INSERT,0;1;2;3;4,4,;>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
list(INSERT listvar 0 "x")
|
||||
set (output "$<LIST:INSERT,0;1;2;3;4,0,x>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
unset(CMAKE_WARN_DEPRECATED CACHE)
|
||||
endblock()
|
||||
list(INSERT listvar 0 "x")
|
||||
set (output "$<LIST:INSERT,0;;1;2;;;3;4,0,x>")
|
||||
if (NOT output STREQUAL listvar)
|
||||
list (APPEND errors "returns bad value: ${output}")
|
||||
endif()
|
||||
|
||||
check_errors("LIST:INSERT..." ${errors})
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
||||
|
||||
@@ -71,7 +71,6 @@ run_cmake(UnterminatedCall2)
|
||||
run_cmake(UnterminatedString)
|
||||
run_cmake(UnterminatedBrace0)
|
||||
run_cmake(UnterminatedBrace1)
|
||||
run_cmake(UnterminatedBrace2)
|
||||
run_cmake(UnterminatedBracket0)
|
||||
run_cmake(UnterminatedBracket1)
|
||||
run_cmake(UnterminatedBracketComment)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CMake Warning \(dev\) at UnterminatedBrace1.cmake:2 \(set\):
|
||||
CMake Error at UnterminatedBrace1.cmake:2 \(set\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:2
|
||||
@@ -7,7 +7,6 @@ CMake Warning \(dev\) at UnterminatedBrace1.cmake:2 \(set\):
|
||||
|
||||
\${
|
||||
|
||||
syntax error, unexpected end of file, expecting } \(3\)
|
||||
There is an unterminated variable reference.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
cmake_policy(SET CMP0010 OLD)
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
set(var "${")
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
CMake Error at UnterminatedBrace2.cmake:3 \(set\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake:3
|
||||
|
||||
when parsing string
|
||||
|
||||
\${
|
||||
|
||||
There is an unterminated variable reference.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
@@ -1,3 +0,0 @@
|
||||
cmake_policy(SET CMP0010 OLD)
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
set(var "${")
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
|
||||
set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupFileSet.vcxproj.filters")
|
||||
if(NOT EXISTS "${vcFiltersFile}")
|
||||
set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
|
||||
set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupTree.vcxproj.filters")
|
||||
if(NOT EXISTS "${vcFiltersFile}")
|
||||
set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
CMake Warning \(dev\) at Before24.cmake:1 \(cmake_minimum_required\):
|
||||
Compatibility with CMake < 2.4 is not supported by CMake >= 3.0.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||
@@ -1 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.2)
|
||||
@@ -8,17 +8,7 @@
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
+
|
||||
CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:2 \(cmake_policy\):
|
||||
Compatibility with CMake < 3\.10 will be removed from a future version of
|
||||
CMake\.
|
||||
|
||||
Update the VERSION argument <min> value\. Or, use the <min>\.\.\.<max> syntax
|
||||
to tell CMake that the project requires at least <min> but has been updated
|
||||
to work with policies introduced by <max> or earlier\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
+
|
||||
CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:6 \(cmake_policy\):
|
||||
CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:5 \(cmake_policy\):
|
||||
Compatibility with CMake < 3\.10 will be removed from a future version of
|
||||
CMake\.
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
cmake_policy(VERSION 2.6)
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call
|
||||
cmake_policy(POP)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
^CMake Error at BeforeVersionRemoved\.cmake:1 \(cmake_minimum_required\):
|
||||
Compatibility with CMake < 2\.8\.0 has been removed from CMake\.
|
||||
|
||||
Update the VERSION argument <min> value\. Or, use the <min>\.\.\.<max> syntax
|
||||
to tell CMake that the project requires at least <min> but has been updated
|
||||
to work with policies introduced by <max> or earlier\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:[0-9]+ \(include\)$
|
||||
@@ -0,0 +1 @@
|
||||
cmake_minimum_required(VERSION 2.6.4)
|
||||
@@ -1,15 +0,0 @@
|
||||
^CMake Deprecation Warning at CompatBefore24\.cmake:1 \(cmake_minimum_required\):
|
||||
Compatibility with CMake < 3\.10 will be removed from a future version of
|
||||
CMake\.
|
||||
|
||||
Update the VERSION argument <min> value\. Or, use the <min>\.\.\.<max> syntax
|
||||
to tell CMake that the project requires at least <min> but has been updated
|
||||
to work with policies introduced by <max> or earlier\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
+
|
||||
CMake Error in CMakeLists.txt:
|
||||
You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less than
|
||||
2.4. This version of CMake only supports backwards compatibility with
|
||||
CMake 2.4 or later. For compatibility with older versions please use any
|
||||
CMake 2.8.x release or lower.
|
||||
@@ -1,2 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.4)
|
||||
set(CMAKE_BACKWARDS_COMPATIBILITY 2.2)
|
||||
@@ -1 +0,0 @@
|
||||
1
|
||||
@@ -1,6 +0,0 @@
|
||||
CMake Error at PolicyBefore24.cmake:2 \(cmake_policy\):
|
||||
Compatibility with CMake < 2.4 is not supported by CMake >= 3.0. For
|
||||
compatibility with older versions please use any CMake 2.8.x release or
|
||||
lower.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
@@ -1,2 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.4)
|
||||
cmake_policy(VERSION 2.2)
|
||||
@@ -0,0 +1,8 @@
|
||||
^CMake Error at PolicyBeforeVersionRemoved\.cmake:1 \(cmake_policy\):
|
||||
Compatibility with CMake < 2\.8\.0 has been removed from CMake\.
|
||||
|
||||
Update the VERSION argument <min> value\. Or, use the <min>\.\.\.<max> syntax
|
||||
to tell CMake that the project requires at least <min> but has been updated
|
||||
to work with policies introduced by <max> or earlier\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:[0-9]+ \(include\)$
|
||||
@@ -0,0 +1 @@
|
||||
cmake_policy(VERSION 2.6.4)
|
||||
@@ -1,9 +1,8 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(Before24)
|
||||
run_cmake(CompatBefore24)
|
||||
run_cmake(BeforeVersionRemoved)
|
||||
run_cmake(PolicyBeforeVersionRemoved)
|
||||
run_cmake(Future)
|
||||
run_cmake(PolicyBefore24)
|
||||
run_cmake(BeforeVersionDeprecated)
|
||||
run_cmake(Range)
|
||||
run_cmake(RangeBad)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
cmake_policy(SET CMP0009 NEW)
|
||||
message(STATUS "Running CMake on GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake")
|
||||
file(GLOB_RECURSE
|
||||
CONTENT_LIST
|
||||
|
||||
@@ -80,8 +80,6 @@ endfunction()
|
||||
|
||||
calling_macro()
|
||||
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
|
||||
# ATTENTION `CMAKE_CURRENT_LIST_LINE` can't be used in `math()'
|
||||
function(print_self)
|
||||
file(STRINGS "${CMAKE_CURRENT_FUNCTION_LIST_FILE}" _lines)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
^CMake Deprecation Warning at GET-CMP0007-WARN\.cmake:1 \(cmake_policy\):
|
||||
Compatibility with CMake < 3\.10 will be removed from a future version of
|
||||
CMake\.
|
||||
|
||||
Update the VERSION argument <min> value\. Or, use the <min>\.\.\.<max> syntax
|
||||
to tell CMake that the project requires at least <min> but has been updated
|
||||
to work with policies introduced by <max> or earlier\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
+
|
||||
CMake Warning \(dev\) at GET-CMP0007-WARN\.cmake:4 \(list\):
|
||||
Policy CMP0007 is not set: list command no longer ignores empty elements.
|
||||
Run "cmake --help-policy CMP0007" for policy details. Use the cmake_policy
|
||||
command to set the policy and suppress this warning. List has value =
|
||||
\[;NEW;OLD\].
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.$
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user