Merge topic 'compute-configure-preset-inheritance-duplicated'
9a18ca3a31 Presets: Remove duplicated call to ComputePresetsInheritance()
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Martin Duffy <martin.duffy@kitware.com>
Merge-request: !10193
diff --git a/Help/command/DEPRECATED_POLICY_VERSIONS.txt b/Help/command/DEPRECATED_POLICY_VERSIONS.txt
index f5104d3..abfc814 100644
--- a/Help/command/DEPRECATED_POLICY_VERSIONS.txt
+++ b/Help/command/DEPRECATED_POLICY_VERSIONS.txt
@@ -1,3 +1,11 @@
+.. versionchanged:: 4.0
+
+ Compatibility with versions of CMake older than 3.0 is removed.
+ Calls to :command:`cmake_minimum_required(VERSION)` or
+ :command:`cmake_policy(VERSION)` that do not specify at least
+ 3.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.
diff --git a/Help/manual/cmake-instrumentation.7.rst b/Help/manual/cmake-instrumentation.7.rst
index a0c43d3..a542646 100644
--- a/Help/manual/cmake-instrumentation.7.rst
+++ b/Help/manual/cmake-instrumentation.7.rst
@@ -232,6 +232,10 @@
The :prop_tgt:`TYPE` of the target. Only included when ``role`` is
``link``.
+ ``targetLabels``
+ The :prop_tgt:`LABELS` of the target. Only included when ``role`` is
+ ``link``.
+
``timeStart``
Time at which the command started, expressed as the number of milliseconds
since the system epoch.
@@ -296,8 +300,8 @@
"beforeCPULoadAverage" : 2.3500000000000001,
"beforeHostMemoryUsed" : 6635832.0
},
- "timeStart" : 31997009,
- "timeStop" : 31997056
+ "timeStart" : 1737053448177,
+ "duration" : 31
}
v1 Index File
diff --git a/Help/policy/CMP0000.rst b/Help/policy/CMP0000.rst
index 5f146bc..2667f3c 100644
--- a/Help/policy/CMP0000.rst
+++ b/Help/policy/CMP0000.rst
@@ -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 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
diff --git a/Help/policy/CMP0001.rst b/Help/policy/CMP0001.rst
index e06f2a1..3a3c442 100644
--- a/Help/policy/CMP0001.rst
+++ b/Help/policy/CMP0001.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0002.rst b/Help/policy/CMP0002.rst
index f50ddd5..ae17c2d 100644
--- a/Help/policy/CMP0002.rst
+++ b/Help/policy/CMP0002.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0003.rst b/Help/policy/CMP0003.rst
index 0a6b778..1dc620c 100644
--- a/Help/policy/CMP0003.rst
+++ b/Help/policy/CMP0003.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0004.rst b/Help/policy/CMP0004.rst
index 74e3e66..d7ee337 100644
--- a/Help/policy/CMP0004.rst
+++ b/Help/policy/CMP0004.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0005.rst b/Help/policy/CMP0005.rst
index 3037a12..9163845 100644
--- a/Help/policy/CMP0005.rst
+++ b/Help/policy/CMP0005.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0006.rst b/Help/policy/CMP0006.rst
index 31efebd..08776f2 100644
--- a/Help/policy/CMP0006.rst
+++ b/Help/policy/CMP0006.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0007.rst b/Help/policy/CMP0007.rst
index b95f36c..7b013db 100644
--- a/Help/policy/CMP0007.rst
+++ b/Help/policy/CMP0007.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0008.rst b/Help/policy/CMP0008.rst
index bcb10d5..d2c95f2 100644
--- a/Help/policy/CMP0008.rst
+++ b/Help/policy/CMP0008.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0009.rst b/Help/policy/CMP0009.rst
index c554522..aeef533 100644
--- a/Help/policy/CMP0009.rst
+++ b/Help/policy/CMP0009.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0010.rst b/Help/policy/CMP0010.rst
index 442553d..1f32283 100644
--- a/Help/policy/CMP0010.rst
+++ b/Help/policy/CMP0010.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0011.rst b/Help/policy/CMP0011.rst
index 976b3c3..98614b9 100644
--- a/Help/policy/CMP0011.rst
+++ b/Help/policy/CMP0011.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0012.rst b/Help/policy/CMP0012.rst
index dd889d2..24cc20b 100644
--- a/Help/policy/CMP0012.rst
+++ b/Help/policy/CMP0012.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0013.rst b/Help/policy/CMP0013.rst
index 4ee19cc..c22d5c9 100644
--- a/Help/policy/CMP0013.rst
+++ b/Help/policy/CMP0013.rst
@@ -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 @@
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
diff --git a/Help/policy/CMP0014.rst b/Help/policy/CMP0014.rst
index 1487bc4..e147705 100644
--- a/Help/policy/CMP0014.rst
+++ b/Help/policy/CMP0014.rst
@@ -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 ``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
diff --git a/Help/policy/CMP0015.rst b/Help/policy/CMP0015.rst
index 2e18506..6fbe833 100644
--- a/Help/policy/CMP0015.rst
+++ b/Help/policy/CMP0015.rst
@@ -1,6 +1,9 @@
CMP0015
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
:command:`link_directories` treats paths relative to the source dir.
In CMake 2.8.0 and lower the :command:`link_directories` command passed
@@ -13,7 +16,5 @@
paths by appending the relative path to ``CMAKE_CURRENT_SOURCE_DIR``.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.1
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0016.rst b/Help/policy/CMP0016.rst
index 960361d..2e5ac53 100644
--- a/Help/policy/CMP0016.rst
+++ b/Help/policy/CMP0016.rst
@@ -1,6 +1,9 @@
CMP0016
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
:command:`target_link_libraries` reports error if its only argument
is not a target.
@@ -10,7 +13,5 @@
in this case.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.3
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0017.rst b/Help/policy/CMP0017.rst
index d06ad13..7bac8a6 100644
--- a/Help/policy/CMP0017.rst
+++ b/Help/policy/CMP0017.rst
@@ -1,6 +1,9 @@
CMP0017
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Prefer files from the CMake module directory when including from there.
Starting with CMake 2.8.4, if a cmake-module shipped with CMake (i.e.
@@ -15,7 +18,5 @@
from the CMake modules directory.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.4
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0018.rst b/Help/policy/CMP0018.rst
index e4cd184..c3ae66f 100644
--- a/Help/policy/CMP0018.rst
+++ b/Help/policy/CMP0018.rst
@@ -1,6 +1,9 @@
CMP0018
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Ignore ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` variable.
CMake 2.8.8 and lower compiled sources in ``SHARED`` and ``MODULE`` libraries
@@ -28,7 +31,5 @@
honor the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.9
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0019.rst b/Help/policy/CMP0019.rst
index f3fa46a..004316f 100644
--- a/Help/policy/CMP0019.rst
+++ b/Help/policy/CMP0019.rst
@@ -1,6 +1,9 @@
CMP0019
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Do not re-expand variables in include and link information.
CMake 2.8.10 and lower re-evaluated values given to the
@@ -16,7 +19,5 @@
the values untouched.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0020.rst b/Help/policy/CMP0020.rst
index 0a4de5c..ceace31 100644
--- a/Help/policy/CMP0020.rst
+++ b/Help/policy/CMP0020.rst
@@ -1,6 +1,9 @@
CMP0020
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Automatically link Qt executables to ``qtmain`` target on Windows.
CMake 2.8.10 and lower required users of Qt to always specify a link
@@ -21,7 +24,5 @@
automatically when they link to QtCore ``IMPORTED`` target.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0021.rst b/Help/policy/CMP0021.rst
index 2c49c33..b9074ab 100644
--- a/Help/policy/CMP0021.rst
+++ b/Help/policy/CMP0021.rst
@@ -1,6 +1,9 @@
CMP0021
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Fatal error on relative paths in :prop_tgt:`INCLUDE_DIRECTORIES` target
property.
@@ -15,7 +18,5 @@
relative path.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0022.rst b/Help/policy/CMP0022.rst
index c82a768..91e7aa3 100644
--- a/Help/policy/CMP0022.rst
+++ b/Help/policy/CMP0022.rst
@@ -1,6 +1,9 @@
CMP0022
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
:prop_tgt:`INTERFACE_LINK_LIBRARIES` defines the link interface.
CMake 2.8.11 constructed the 'link interface' of a target from
@@ -33,7 +36,5 @@
``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?``.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0023.rst b/Help/policy/CMP0023.rst
index c863a91..265136f 100644
--- a/Help/policy/CMP0023.rst
+++ b/Help/policy/CMP0023.rst
@@ -1,6 +1,9 @@
CMP0023
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Plain and keyword :command:`target_link_libraries` signatures cannot be mixed.
CMake 2.8.12 introduced the :command:`target_link_libraries` signature using
@@ -29,7 +32,5 @@
signatures.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/CMP0024.rst b/Help/policy/CMP0024.rst
index c9fd472..72dbc0e 100644
--- a/Help/policy/CMP0024.rst
+++ b/Help/policy/CMP0024.rst
@@ -1,6 +1,9 @@
CMP0024
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Disallow include export result.
CMake 2.8.12 and lower allowed use of the :command:`include` command with the
@@ -18,7 +21,5 @@
allow including the result of an :command:`export` command.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0025.rst b/Help/policy/CMP0025.rst
index cfbed2a..d0f67f9 100644
--- a/Help/policy/CMP0025.rst
+++ b/Help/policy/CMP0025.rst
@@ -1,6 +1,9 @@
CMP0025
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Compiler id for Apple Clang is now ``AppleClang``.
CMake 3.0 and above recognize that Apple Clang is a different compiler
@@ -19,11 +22,9 @@
``NEW`` behavior for this policy is to use compiler id ``AppleClang``.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
+.. include:: REMOVED_EPILOGUE.txt
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0025 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
-variable to control the warning.
-
-.. include:: DEPRECATED.txt
+variable to control the warning in CMake versions before 4.0.
diff --git a/Help/policy/CMP0026.rst b/Help/policy/CMP0026.rst
index b2a5f25..06b1dd1 100644
--- a/Help/policy/CMP0026.rst
+++ b/Help/policy/CMP0026.rst
@@ -1,6 +1,9 @@
CMP0026
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Disallow use of the LOCATION property for build targets.
CMake 2.8.12 and lower allowed reading the :prop_tgt:`LOCATION` target
@@ -23,7 +26,5 @@
not to allow reading the :prop_tgt:`LOCATION` properties from build-targets.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0027.rst b/Help/policy/CMP0027.rst
index 78c01f7..eaf1929 100644
--- a/Help/policy/CMP0027.rst
+++ b/Help/policy/CMP0027.rst
@@ -1,6 +1,9 @@
CMP0027
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Conditionally linked imported targets with missing include directories.
CMake 2.8.11 introduced introduced the concept of
@@ -21,7 +24,5 @@
conditionally linked ``IMPORTED`` target does not exist.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0028.rst b/Help/policy/CMP0028.rst
index 18b17ee..c0ba715 100644
--- a/Help/policy/CMP0028.rst
+++ b/Help/policy/CMP0028.rst
@@ -1,6 +1,9 @@
CMP0028
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Double colon in target name means ``ALIAS`` or ``IMPORTED`` target.
CMake 2.8.12 and lower allowed the use of targets and files with double
@@ -21,7 +24,5 @@
double-colons but is not an ``IMPORTED`` target or an ``ALIAS`` target.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0029.rst b/Help/policy/CMP0029.rst
index aa10b97..b5cca1e 100644
--- a/Help/policy/CMP0029.rst
+++ b/Help/policy/CMP0029.rst
@@ -1,12 +1,13 @@
CMP0029
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`subdir_depends` command should not be called.
The implementation of this command has been empty since December 2001
but was kept in CMake for compatibility for a long time.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0030.rst b/Help/policy/CMP0030.rst
index 81bbb84..a0b11d5 100644
--- a/Help/policy/CMP0030.rst
+++ b/Help/policy/CMP0030.rst
@@ -1,6 +1,9 @@
CMP0030
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`use_mangled_mesa` command should not be called.
This command was created in September 2001 to support VTK before
@@ -8,6 +11,4 @@
not used it in years.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0031.rst b/Help/policy/CMP0031.rst
index 8c3eef6..7e5f22d 100644
--- a/Help/policy/CMP0031.rst
+++ b/Help/policy/CMP0031.rst
@@ -1,6 +1,9 @@
CMP0031
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`load_command` command should not be called.
This command was added in August 2002 to allow projects to add
@@ -10,6 +13,4 @@
:command:`macro` and :command:`function` commands.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0032.rst b/Help/policy/CMP0032.rst
index 5c1fa4b..26a9c15 100644
--- a/Help/policy/CMP0032.rst
+++ b/Help/policy/CMP0032.rst
@@ -1,6 +1,9 @@
CMP0032
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`output_required_files` command should not be called.
This command was added in June 2001 to expose the then-current CMake
@@ -10,6 +13,4 @@
functionality is better achieved through dedicated outside tools.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0033.rst b/Help/policy/CMP0033.rst
index 4a6cc59..7f84dc0 100644
--- a/Help/policy/CMP0033.rst
+++ b/Help/policy/CMP0033.rst
@@ -1,6 +1,9 @@
CMP0033
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`export_library_dependencies` command should not be called.
This command was added in January 2003 to export ``<tgt>_LIB_DEPENDS``
@@ -11,6 +14,4 @@
:command:`install(EXPORT)` commands.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0034.rst b/Help/policy/CMP0034.rst
index 0f3934a..386cd34 100644
--- a/Help/policy/CMP0034.rst
+++ b/Help/policy/CMP0034.rst
@@ -1,6 +1,9 @@
CMP0034
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`utility_source` command should not be called.
This command was introduced in March 2001 to help build executables used to
@@ -8,6 +11,4 @@
:command:`add_executable` combined with :command:`add_custom_command`.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0035.rst b/Help/policy/CMP0035.rst
index 58199a4..b3e818e 100644
--- a/Help/policy/CMP0035.rst
+++ b/Help/policy/CMP0035.rst
@@ -1,12 +1,13 @@
CMP0035
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`variable_requires` command should not be called.
This command was introduced in November 2001 to perform some conditional
logic. It has long been replaced by the :command:`if` command.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0036.rst b/Help/policy/CMP0036.rst
index 4bcfc54..0d1f857 100644
--- a/Help/policy/CMP0036.rst
+++ b/Help/policy/CMP0036.rst
@@ -1,6 +1,9 @@
CMP0036
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`build_name` command should not be called.
This command was added in May 2001 to compute a name for the current
@@ -9,6 +12,4 @@
and :variable:`CMAKE_<LANG>_COMPILER` variables.
.. |disallowed_version| replace:: 3.0
-.. include:: DISALLOWED_COMMAND.txt
-
-.. include:: DEPRECATED.txt
+.. include:: REMOVED_COMMAND.txt
diff --git a/Help/policy/CMP0037.rst b/Help/policy/CMP0037.rst
index f912a22..5d3f518 100644
--- a/Help/policy/CMP0037.rst
+++ b/Help/policy/CMP0037.rst
@@ -1,6 +1,9 @@
CMP0037
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Target names should not be reserved and should match a validity pattern.
CMake 2.8.12 and lower allowed creating targets using :command:`add_library`,
@@ -28,7 +31,5 @@
if an add_* command is used with an invalid target name.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0038.rst b/Help/policy/CMP0038.rst
index b0de8ca..df147de 100644
--- a/Help/policy/CMP0038.rst
+++ b/Help/policy/CMP0038.rst
@@ -1,6 +1,9 @@
CMP0038
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Targets may not link directly to themselves.
CMake 2.8.12 and lower allowed a build target to link to itself directly with
@@ -12,7 +15,5 @@
report an error if a target attempts to link to itself.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0039.rst b/Help/policy/CMP0039.rst
index 558c5c5..4a0a7aa 100644
--- a/Help/policy/CMP0039.rst
+++ b/Help/policy/CMP0039.rst
@@ -1,6 +1,9 @@
CMP0039
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Utility targets may not have link dependencies.
CMake 2.8.12 and lower allowed using utility targets in the left hand side
@@ -13,7 +16,5 @@
utility target.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0040.rst b/Help/policy/CMP0040.rst
index b6777ef..7d7bec0 100644
--- a/Help/policy/CMP0040.rst
+++ b/Help/policy/CMP0040.rst
@@ -1,6 +1,9 @@
CMP0040
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The target in the ``TARGET`` signature of :command:`add_custom_command`
must exist and must be defined in the current directory.
@@ -14,7 +17,5 @@
unknown or was defined outside the current directory.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0041.rst b/Help/policy/CMP0041.rst
index bf9e8a5..d3f0043 100644
--- a/Help/policy/CMP0041.rst
+++ b/Help/policy/CMP0041.rst
@@ -1,6 +1,9 @@
CMP0041
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Error on relative include with generator expression.
Diagnostics in CMake 2.8.12 and lower silently ignored an entry in the
@@ -21,7 +24,5 @@
relative.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0042.rst b/Help/policy/CMP0042.rst
index 8fb8cb2..3985e21 100644
--- a/Help/policy/CMP0042.rst
+++ b/Help/policy/CMP0042.rst
@@ -1,6 +1,9 @@
CMP0042
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
:prop_tgt:`MACOSX_RPATH` is enabled by default.
CMake 2.8.12 and newer has support for using ``@rpath`` in a target's install
@@ -15,7 +18,5 @@
variables.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0043.rst b/Help/policy/CMP0043.rst
index decd228..5b248b9 100644
--- a/Help/policy/CMP0043.rst
+++ b/Help/policy/CMP0043.rst
@@ -1,6 +1,9 @@
CMP0043
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Ignore COMPILE_DEFINITIONS_<Config> properties
CMake 2.8.12 and lower allowed setting the
@@ -41,7 +44,5 @@
of the :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target property .
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0044.rst b/Help/policy/CMP0044.rst
index 36c2839..9ee1be1 100644
--- a/Help/policy/CMP0044.rst
+++ b/Help/policy/CMP0044.rst
@@ -1,6 +1,9 @@
CMP0044
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Case sensitive ``<LANG>_COMPILER_ID`` generator expressions
CMake 2.8.12 introduced the ``<LANG>_COMPILER_ID``
@@ -15,7 +18,5 @@
the ``<LANG>_COMPILER_ID`` expression.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0045.rst b/Help/policy/CMP0045.rst
index 257abfa..5dea2b6 100644
--- a/Help/policy/CMP0045.rst
+++ b/Help/policy/CMP0045.rst
@@ -1,6 +1,9 @@
CMP0045
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Error on non-existent target in get_target_property.
In CMake 2.8.12 and lower, the :command:`get_target_property` command accepted
@@ -13,7 +16,5 @@
non-existent target.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0046.rst b/Help/policy/CMP0046.rst
index 6e9bc72..cf45945 100644
--- a/Help/policy/CMP0046.rst
+++ b/Help/policy/CMP0046.rst
@@ -1,6 +1,9 @@
CMP0046
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Error on non-existent dependency in add_dependencies.
CMake 2.8.12 and lower silently ignored non-existent dependencies
@@ -12,7 +15,5 @@
command.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0047.rst b/Help/policy/CMP0047.rst
index e82d72c..e890260 100644
--- a/Help/policy/CMP0047.rst
+++ b/Help/policy/CMP0047.rst
@@ -1,6 +1,9 @@
CMP0047
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Use ``QCC`` compiler id for the qcc drivers on QNX.
CMake 3.0 and above recognize that the QNX qcc compiler driver is
@@ -20,11 +23,9 @@
is to use the ``QCC`` compiler id for those drivers.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
+.. include:: REMOVED_EPILOGUE.txt
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0047 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
-variable to control the warning.
-
-.. include:: DEPRECATED.txt
+variable to control the warning in CMake versions before 4.0.
diff --git a/Help/policy/CMP0048.rst b/Help/policy/CMP0048.rst
index 6192136..76a74ce 100644
--- a/Help/policy/CMP0048.rst
+++ b/Help/policy/CMP0048.rst
@@ -1,6 +1,9 @@
CMP0048
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
The :command:`project` command manages ``VERSION`` variables.
CMake version 3.0 introduced the ``VERSION`` option of the :command:`project`
@@ -17,7 +20,5 @@
:command:`project` command.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0049.rst b/Help/policy/CMP0049.rst
index d12ef88..c2500cd 100644
--- a/Help/policy/CMP0049.rst
+++ b/Help/policy/CMP0049.rst
@@ -1,6 +1,9 @@
CMP0049
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Do not expand variables in target source entries.
CMake 2.8.12 and lower performed an extra layer of variable expansion
@@ -18,7 +21,5 @@
if such variables need to be expanded.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/CMP0050.rst b/Help/policy/CMP0050.rst
index 1b93773..dcd68a6 100644
--- a/Help/policy/CMP0050.rst
+++ b/Help/policy/CMP0050.rst
@@ -1,6 +1,9 @@
CMP0050
-------
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
Disallow add_custom_command SOURCE signatures.
CMake 2.8.12 and lower allowed a signature for :command:`add_custom_command`
@@ -13,7 +16,5 @@
policy is to issue an error if such a signature is used.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.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
diff --git a/Help/policy/REMOVED_COMMAND.txt b/Help/policy/REMOVED_COMMAND.txt
new file mode 100644
index 0000000..1c8c963
--- /dev/null
+++ b/Help/policy/REMOVED_COMMAND.txt
@@ -0,0 +1,8 @@
+CMake >= |disallowed_version| prefer that this command never be called.
+The ``OLD`` behavior for this policy is to allow the command to be called.
+The ``NEW`` behavior for this policy is to issue a ``FATAL_ERROR`` when the
+command is called.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: |disallowed_version|
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/REMOVED_EPILOGUE.txt b/Help/policy/REMOVED_EPILOGUE.txt
new file mode 100644
index 0000000..b7434bc
--- /dev/null
+++ b/Help/policy/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.
diff --git a/Help/policy/REMOVED_PROLOGUE.txt b/Help/policy/REMOVED_PROLOGUE.txt
new file mode 100644
index 0000000..5141b6e
--- /dev/null
+++ b/Help/policy/REMOVED_PROLOGUE.txt
@@ -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`.
diff --git a/Help/prop_sf/COMPILE_DEFINITIONS.rst b/Help/prop_sf/COMPILE_DEFINITIONS.rst
index 2af896e..d14d637 100644
--- a/Help/prop_sf/COMPILE_DEFINITIONS.rst
+++ b/Help/prop_sf/COMPILE_DEFINITIONS.rst
@@ -28,5 +28,5 @@
that depend on the build configuration are not allowed with that
generator.
-Generator expressions should be preferred instead of setting the alternative per-configuration
-property.
+Prefer using generator expressions in :prop_sf:`!COMPILE_DEFINITIONS` over the
+deprecated :prop_sf:`COMPILE_DEFINITIONS_<CONFIG>` property.
diff --git a/Help/prop_sf/COMPILE_DEFINITIONS_CONFIG.rst b/Help/prop_sf/COMPILE_DEFINITIONS_CONFIG.rst
index ec867b6..a1ea26e 100644
--- a/Help/prop_sf/COMPILE_DEFINITIONS_CONFIG.rst
+++ b/Help/prop_sf/COMPILE_DEFINITIONS_CONFIG.rst
@@ -1,10 +1,14 @@
COMPILE_DEFINITIONS_<CONFIG>
----------------------------
-Ignored. See CMake Policy :policy:`CMP0043`.
+.. deprecated:: 3.0
+
+ Prefer the :prop_sf:`COMPILE_DEFINITIONS` source-file property with
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
Per-configuration preprocessor definitions on a source file.
-This is the configuration-specific version of :prop_tgt:`COMPILE_DEFINITIONS`.
+This is the configuration-specific version of :prop_sf:`COMPILE_DEFINITIONS`.
+
Note that :generator:`Xcode` does not support per-configuration source
file flags so this property will be ignored by the :generator:`Xcode` generator.
diff --git a/Help/release/dev/remove-old-compatibility.rst b/Help/release/dev/remove-old-compatibility.rst
new file mode 100644
index 0000000..6c0582f
--- /dev/null
+++ b/Help/release/dev/remove-old-compatibility.rst
@@ -0,0 +1,10 @@
+remove-old-compatibility
+------------------------
+
+* Compatibility with versions of CMake older than 3.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.
diff --git a/Help/variable/CMAKE_BACKWARDS_COMPATIBILITY.rst b/Help/variable/CMAKE_BACKWARDS_COMPATIBILITY.rst
index 05c366a..7e99598 100644
--- a/Help/variable/CMAKE_BACKWARDS_COMPATIBILITY.rst
+++ b/Help/variable/CMAKE_BACKWARDS_COMPATIBILITY.rst
@@ -1,4 +1,4 @@
CMAKE_BACKWARDS_COMPATIBILITY
-----------------------------
-Deprecated. See CMake Policy :policy:`CMP0001` documentation.
+Removed. See policy :policy:`CMP0001`.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index 59fa0be..81978c1 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -6,10 +6,10 @@
by :command:`cmake_minimum_required`. This is meaningful
only for the policies that do not warn by default:
-* ``CMAKE_POLICY_WARNING_CMP0025`` controls the warning for
- policy :policy:`CMP0025`.
-* ``CMAKE_POLICY_WARNING_CMP0047`` controls the warning for
- policy :policy:`CMP0047`.
+* ``CMAKE_POLICY_WARNING_CMP0025`` controlled the warning for
+ policy :policy:`CMP0025` in CMake versions before 4.0.
+* ``CMAKE_POLICY_WARNING_CMP0047`` controlled the warning for
+ policy :policy:`CMP0047` in CMake versions before 4.0.
* ``CMAKE_POLICY_WARNING_CMP0056`` controls the warning for
policy :policy:`CMP0056`.
* ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 2042e64..412fe36 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -130,6 +130,10 @@
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_QCC "-V")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_QCC "gcc_nto")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Tasking)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Tasking "--version")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Tasking "TASKING")
+
include(CMakeDetermineCompilerId)
set(userflags)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}")
diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake
index b022217..8d21155 100644
--- a/Modules/CMakeIOSInstallCombined.cmake
+++ b/Modules/CMakeIOSInstallCombined.cmake
@@ -60,9 +60,6 @@
# 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 @@
_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
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index 50bd90b..0cd55e1 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -5,38 +5,132 @@
CMakePushCheckState
-------------------
+This module provides macros for managing the state of variables that influence
+how various CMake check commands (e.g., ``check_symbol_exists()``, etc.) are
+performed. These macros save, reset, and restore the following variables:
+* ``CMAKE_REQUIRED_FLAGS``
+* ``CMAKE_REQUIRED_DEFINITIONS``
+* ``CMAKE_REQUIRED_INCLUDES``
+* ``CMAKE_REQUIRED_LINK_OPTIONS``
+* ``CMAKE_REQUIRED_LIBRARIES``
+* ``CMAKE_REQUIRED_LINK_DIRECTORIES``
+* ``CMAKE_REQUIRED_QUIET``
+* ``CMAKE_EXTRA_INCLUDE_FILES``
-This module defines three macros: ``CMAKE_PUSH_CHECK_STATE()``
-``CMAKE_POP_CHECK_STATE()`` and ``CMAKE_RESET_CHECK_STATE()`` These macros can
-be used to save, restore and reset (i.e., clear contents) the state of
-the variables ``CMAKE_REQUIRED_FLAGS``, ``CMAKE_REQUIRED_DEFINITIONS``,
-``CMAKE_REQUIRED_LINK_OPTIONS``, ``CMAKE_REQUIRED_LIBRARIES``,
-``CMAKE_REQUIRED_LINK_DIRECTORIES``,
-``CMAKE_REQUIRED_INCLUDES`` and ``CMAKE_EXTRA_INCLUDE_FILES`` used by the
-various Check-files coming with CMake, like e.g. ``check_function_exists()``
-etc.
-The variable contents are pushed on a stack, pushing multiple times is
-supported. This is useful e.g. when executing such tests in a Find-module,
-where they have to be set, but after the Find-module has been executed they
-should have the same value as they had before.
+Macros
+^^^^^^
-``CMAKE_PUSH_CHECK_STATE()`` macro receives optional argument ``RESET``.
-Whether it's specified, ``CMAKE_PUSH_CHECK_STATE()`` will set all
-``CMAKE_REQUIRED_*`` variables to empty values, same as
-``CMAKE_RESET_CHECK_STATE()`` call will do.
+.. command:: cmake_push_check_state
-Usage:
+ Saves (pushes) the current states of the above variables onto a stack. This
+ is typically used to preserve the current configuration before making
+ temporary modifications for specific checks.
+
+ .. code-block:: cmake
+
+ cmake_push_check_state([RESET])
+
+ ``RESET``
+ When this option is specified, the macro not only saves the current states
+ of the listed variables but also resets them to empty, allowing them to be
+ reconfigured from a clean state.
+
+.. command:: cmake_reset_check_state
+
+ Resets (clears) the contents of the variables listed above to empty states.
+
+ .. code-block:: cmake
+
+ cmake_reset_check_state()
+
+ This macro can be used, for example, when performing multiple sequential
+ checks that require entirely new configurations, ensuring no previous
+ configuration unintentionally carries over.
+
+.. command:: cmake_pop_check_state
+
+ Restores the states of the variables listed above to their values at the time
+ of the most recent ``cmake_push_check_state()`` call.
+
+ .. code-block:: cmake
+
+ cmake_pop_check_state()
+
+ This macro is used to revert temporary changes made during a check. To
+ prevent unexpected behavior, pair each ``cmake_push_check_state()`` with a
+ corresponding ``cmake_pop_check_state()``.
+
+These macros are useful for scoped configuration, for example, in
+:ref:`Find modules <Find Modules>` or when performing checks in a controlled
+environment, ensuring that temporary modifications are isolated to the scope of
+the check and do not propagate into other parts of the build system.
+
+.. note::
+
+ Other CMake variables, such as ``CMAKE_<LANG>_FLAGS``, propagate to all checks
+ regardless of these macros, as those fundamental variables are designed to
+ influence the global state of the build system.
+
+Examples
+^^^^^^^^
.. code-block:: cmake
- cmake_push_check_state(RESET)
- set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
- check_function_exists(...)
- cmake_reset_check_state()
- set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
- check_function_exists(...)
- cmake_pop_check_state()
+ include(CMakePushCheckState)
+
+ # Save and reset the current state
+ cmake_push_check_state(RESET)
+
+ # Perform check with specific compile definitions
+ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+ include(CheckSymbolExists)
+ check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE)
+
+ # Restore the original state
+ cmake_pop_check_state()
+
+Variable states can be pushed onto the stack multiple times, allowing for nested
+or sequential configurations. Each ``cmake_pop_check_state()`` restores the
+most recent pushed states.
+
+.. code-block:: cmake
+
+ include(CMakePushCheckState)
+
+ # Save and reset the current state
+ cmake_push_check_state(RESET)
+
+ # Perform the first check with additional libraries
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
+ include(CheckSymbolExists)
+ check_symbol_exists(dlopen "dlfcn.h" HAVE_DLOPEN)
+
+ # Save current state
+ cmake_push_check_state()
+
+ # Perform the second check with libraries and additional compile definitions
+ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+ check_symbol_exists(dladdr "dlfcn.h" HAVE_DLADDR)
+
+ message(STATUS "${CMAKE_REQUIRED_DEFINITIONS}")
+ # Output: -D_GNU_SOURCE
+
+ # Restore the previous state
+ cmake_pop_check_state()
+
+ message(STATUS "${CMAKE_REQUIRED_DEFINITIONS}")
+ # Output here is empty
+
+ # Reset variables to prepare for the next check
+ cmake_reset_check_state()
+
+ # Perform the next check only with additional compile definitions
+ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+ check_symbol_exists(dl_iterate_phdr "link.h" HAVE_DL_ITERATE_PHDR)
+
+ # Restore the original state
+ cmake_pop_check_state()
#]=======================================================================]
macro(CMAKE_RESET_CHECK_STATE)
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index fe27295..4d9f21f 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -13,7 +13,7 @@
.. command:: check_ipo_supported
- ::
+ .. code-block:: cmake
check_ipo_supported([RESULT <result>] [OUTPUT <output>]
[LANGUAGES <lang>...])
@@ -28,13 +28,29 @@
Set ``<output>`` variable with details about any error.
``LANGUAGES <lang>...``
Specify languages whose compilers to check.
- Languages ``C``, ``CXX``, and ``Fortran`` are supported.
-It makes no sense to use this module when :policy:`CMP0069` is set to ``OLD`` so
-module will return error in this case. See policy :policy:`CMP0069` for details.
+ The following languages are supported:
+
+ * ``C``
+
+ * ``CXX``
+
+ * ``CUDA``
+
+ .. versionadded:: 3.25
+
+ * ``Fortran``
+
+ If this option is not given, the default languages are picked from
+ the current :prop_gbl:`ENABLED_LANGUAGES` global property.
+
+.. note::
+
+ To use ``check_ipo_supported()``, policy :policy:`CMP0069` must be set to
+ ``NEW``; otherwise, a fatal error will occur.
.. versionadded:: 3.13
- Add support for Visual Studio generators.
+ Support for Visual Studio generators.
.. versionadded:: 3.24
The check uses the caller's :variable:`CMAKE_<LANG>_FLAGS`
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index c9b1669..2df31de 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -1,11 +1,6 @@
include(Compiler/Clang)
__compiler_clang(C)
-cmake_policy(GET CMP0025 appleClangPolicy)
-if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
- return()
-endif()
-
if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC)
set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 46fc48d..87a4cdd 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -15,11 +15,6 @@
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
-cmake_policy(GET CMP0025 appleClangPolicy)
-if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
- return()
-endif()
-
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl")
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl")
diff --git a/Modules/Compiler/Tasking-ASM.cmake b/Modules/Compiler/Tasking-ASM.cmake
index 19bce19..eabc77b 100644
--- a/Modules/Compiler/Tasking-ASM.cmake
+++ b/Modules/Compiler/Tasking-ASM.cmake
@@ -1,7 +1,6 @@
include(Compiler/Tasking)
+__compiler_tasking(ASM)
set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
-set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1)
-set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
-set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS S;s;asm;msa)
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm;src)
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 055a0ee..c8c23e1 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -869,10 +869,7 @@
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}))$")
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index 17e12f8..32c5268 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -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 @@
)
endif()
-
-cmake_policy(POP)
diff --git a/Modules/FindEnvModules.cmake b/Modules/FindEnvModules.cmake
index 5337e4f..9149af3 100644
--- a/Modules/FindEnvModules.cmake
+++ b/Modules/FindEnvModules.cmake
@@ -268,7 +268,6 @@
#------------------------------------------------------------------------------
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 @@
#------------------------------------------------------------------------------
function(env_module_avail)
- cmake_policy(SET CMP0007 NEW)
-
if(ARGC EQUAL 1)
set(mod_prefix)
set(out_var ${ARGV0})
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index 9a11b88..11fa3c8 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -79,7 +79,7 @@
if(GIF_INCLUDE_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckStructHasMember.cmake)
- CMAKE_PUSH_CHECK_STATE()
+ cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${GIF_FIND_QUIETLY})
set(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
@@ -105,7 +105,7 @@
unset(_GIF_MIN)
unset(_GIF_REL)
unset(_GIF_DEFS)
- CMAKE_POP_CHECK_STATE()
+ cmake_pop_check_state()
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index b4106c4..0461cbb 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -44,7 +44,6 @@
#]=======================================================================]
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)
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index b3fa1cc..c0f45df 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -46,7 +46,7 @@
include(CMakePushCheckState)
set(CMAKE_REQUIRED_QUIET ${OpenCL_FIND_QUIETLY})
- CMAKE_PUSH_CHECK_STATE()
+ cmake_push_check_state()
foreach(VERSION "3_0" "2_2" "2_1" "2_0" "1_2" "1_1" "1_0")
set(CMAKE_REQUIRED_INCLUDES "${OpenCL_INCLUDE_DIR}")
@@ -73,7 +73,7 @@
break()
endif()
endforeach()
- CMAKE_POP_CHECK_STATE()
+ cmake_pop_check_state()
endfunction()
find_path(OpenCL_INCLUDE_DIR
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 674b161..3c6149f 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -111,7 +111,6 @@
#]=======================================================================]
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>
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 3360cb2..0b7325d 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -215,8 +215,6 @@
cmake_policy(PUSH)
-# numbers and boolean constants
-cmake_policy(SET CMP0012 NEW)
# IN_LIST operator
cmake_policy(SET CMP0057 NEW)
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index d2a1457..4a1b061 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -623,8 +623,6 @@
cmake_policy(PUSH)
-# numbers and boolean constants
-cmake_policy (SET CMP0012 NEW)
# foreach loop variable scope
cmake_policy (SET CMP0124 NEW)
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 7bfdd88..c647315 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -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
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 91b83c8..6e1ffbc 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1080,23 +1080,21 @@
set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
set(_isWin32 $<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>)
set(_isNotExcluded $<NOT:$<BOOL:$<TARGET_PROPERTY:QT4_NO_LINK_QTMAIN>>>)
- set(_isPolicyNEW $<TARGET_POLICY:CMP0020>)
get_target_property(_configs Qt4::QtCore IMPORTED_CONFIGURATIONS)
set_property(TARGET Qt4::QtCore APPEND PROPERTY
INTERFACE_LINK_LIBRARIES
- $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt4::qtmain>
+ $<$<AND:${_isExe},${_isWin32},${_isNotExcluded}>:Qt4::qtmain>
)
foreach(_config ${_configs})
set_property(TARGET Qt4::QtCore APPEND PROPERTY
IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
- $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt4::qtmain>
+ $<$<AND:${_isExe},${_isWin32},${_isNotExcluded}>:Qt4::qtmain>
)
endforeach()
unset(_configs)
unset(_isExe)
unset(_isWin32)
unset(_isNotExcluded)
- unset(_isPolicyNEW)
endif()
#######################################
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 14f5578..c967839 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -112,16 +112,6 @@
# on which version of ruby is required
set(_Ruby_POSSIBLE_EXECUTABLE_NAMES ruby)
-# If not specified, allow everything as far back as 1.8.0
-if(NOT DEFINED Ruby_FIND_VERSION_MAJOR)
- set(Ruby_FIND_VERSION "1.8.0")
- set(Ruby_FIND_VERSION_MAJOR 1)
- set(Ruby_FIND_VERSION_MINOR 8)
- set(Ruby_FIND_VERSION_PATCH 0)
-endif()
-
-set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${Ruby_FIND_VERSION_MINOR}")
-
# Set name of possible executables, ignoring the minor
# Eg:
# 3.2.6 => from ruby34 to ruby32 included
@@ -146,42 +136,34 @@
set (Ruby_FIND_VIRTUALENV "FIRST")
endif()
-function (_RUBY_VALIDATE_INTERPRETER)
- if (NOT Ruby_EXECUTABLE)
+function (_RUBY_VALIDATE_INTERPRETER result_var path)
+ # Get the interpreter version
+ execute_process (COMMAND "${path}" -e "puts RUBY_VERSION"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE version
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if (NOT result EQUAL 0)
+ set (_Ruby_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${path}\"")
+ set(${result_var} FALSE PARENT_SCOPE)
return()
endif()
- cmake_parse_arguments (PARSE_ARGV 0 _RVI "EXACT;CHECK_EXISTS" "" "")
- if (_RVI_UNPARSED_ARGUMENTS)
- set (expected_version ${_RVI_UNPARSED_ARGUMENTS})
- else()
- unset (expected_version)
- endif()
-
- if (_RVI_CHECK_EXISTS AND NOT EXISTS "${Ruby_EXECUTABLE}")
- # interpreter does not exist anymore
- set (_Ruby_Interpreter_REASON_FAILURE "Cannot find the interpreter \"${Ruby_EXECUTABLE}\"")
- set_property (CACHE Ruby_EXECUTABLE PROPERTY VALUE "Ruby_EXECUTABLE-NOTFOUND")
- return()
- endif()
-
- # Check the version it returns
- # executable found must have a specific version
- execute_process (COMMAND "${Ruby_EXECUTABLE}" -e "puts RUBY_VERSION"
- RESULT_VARIABLE result
- OUTPUT_VARIABLE version
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (result OR (_RVI_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version))
- # interpreter not usable or has wrong major version
- if (result)
- set (_Ruby_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${Ruby_EXECUTABLE}\"")
- else()
- set (_Ruby_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${Ruby_EXECUTABLE}\"")
+ if (Ruby_FIND_VERSION)
+ if (Ruby_FIND_VERSION_EXACT AND NOT version VERSION_EQUAL Ruby_FIND_VERSION)
+ message(DEBUG "Incorrect Ruby found. Requested: ${Ruby_FIND_VERSION}. Found: ${version}. Path: \"${path}\"")
+ set(${result_var} FALSE PARENT_SCOPE)
+ return()
+ elseif (version VERSION_LESS Ruby_FIND_VERSION)
+ message(DEBUG "Ruby version is too old. Minimum: ${Ruby_FIND_VERSION}. Found: ${version}. Path: \"${path}\"")
+ set(${result_var} FALSE PARENT_SCOPE)
+ return()
endif()
- set_property (CACHE Ruby_EXECUTABLE PROPERTY VALUE "Ruby_EXECUTABLE-NOTFOUND")
- return()
endif()
+
+ # Found valid Ruby interpreter!
+ set(${result_var} TRUE PARENT_SCOPE)
endfunction()
function(_RUBY_CONFIG_VAR RBVAR OUTVAR)
@@ -198,7 +180,7 @@
set(${OUTVAR} "${_Ruby_OUTPUT}" PARENT_SCOPE)
endfunction()
-#### Check RMV virtual environment ###
+#### Check RVM virtual environment ###
function (_RUBY_CHECK_RVM)
if (NOT DEFINED ENV{MY_RUBY_HOME})
return()
@@ -209,13 +191,12 @@
NAMES_PER_DIR
PATHS ENV MY_RUBY_HOME
PATH_SUFFIXES bin Scripts
+ VALIDATOR _RUBY_VALIDATE_INTERPRETER
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
- _RUBY_VALIDATE_INTERPRETER (${Ruby_FIND_VERSION}})
-
if(Ruby_EXECUTABLE)
set(Ruby_ENV "RVM" CACHE INTERNAL "Ruby environment")
endif()
@@ -225,28 +206,25 @@
function (_RUBY_CHECK_SYSTEM)
find_program (Ruby_EXECUTABLE
NAMES ${_Ruby_POSSIBLE_EXECUTABLE_NAMES}
- NAMES_PER_DIR)
-
- _RUBY_VALIDATE_INTERPRETER (${Ruby_FIND_VERSION})
+ NAMES_PER_DIR
+ VALIDATOR _RUBY_VALIDATE_INTERPRETER)
if(Ruby_EXECUTABLE)
set(Ruby_ENV "Standard" CACHE INTERNAL "Ruby environment")
endif()
endfunction()
-# Find Ruby! First check virtual environments
-if(Ruby_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY)$")
- if(NOT Ruby_EXECUTABLE)
- _RUBY_CHECK_RVM()
- endif()
+# Find Ruby
+if(NOT Ruby_EXECUTABLE AND Ruby_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY)$")
+ _RUBY_CHECK_RVM()
endif()
-# If we did not find a virtual environment then look for a system installed Ruby
-if(NOT ${Ruby_FIND_VIRTUALENV} STREQUAL "ONLY" AND NOT Ruby_EXECUTABLE)
+# Check for system installed Ruby
+if(NOT Ruby_EXECUTABLE AND NOT Ruby_FIND_VIRTUALENV STREQUAL "ONLY")
_RUBY_CHECK_SYSTEM()
endif()
-if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_MAJOR)
+if(Ruby_EXECUTABLE AND NOT Ruby_EXECUTABLE STREQUAL "${_Ruby_EXECUTABLE_LAST_QUERIED}")
# query the ruby version
_RUBY_CONFIG_VAR("MAJOR" Ruby_VERSION_MAJOR)
_RUBY_CONFIG_VAR("MINOR" Ruby_VERSION_MINOR)
@@ -274,6 +252,7 @@
endif()
# save the results in the cache so we don't have to run ruby the next time again
+ set(_Ruby_EXECUTABLE_LAST_QUERIED "${Ruby_EXECUTABLE}" CACHE INTERNAL "The ruby executable last queried for version and path info")
set(Ruby_VERSION_MAJOR ${Ruby_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)
set(Ruby_VERSION_MINOR ${Ruby_VERSION_MINOR} CACHE PATH "The Ruby minor version" FORCE)
set(Ruby_VERSION_PATCH ${Ruby_VERSION_PATCH} CACHE PATH "The Ruby patch version" FORCE)
@@ -363,7 +342,6 @@
set(Ruby_INCLUDE_DIRS ${Ruby_INCLUDE_DIRS} ${Ruby_CONFIG_INCLUDE_DIR} )
endif()
-
# Determine the list of possible names for the ruby library
set(_Ruby_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_Ruby_VERSION_SHORT} ruby${_Ruby_VERSION_SHORT_NODOT} ruby${_Ruby_NODOT_VERSION} ruby-${_Ruby_VERSION_SHORT} ruby-${Ruby_VERSION})
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 81481a7..3b0e13b 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -195,9 +195,6 @@
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 @@
"The output was:\n ${_output}")
endif()
endfunction()
-
-# Restore including context policies.
-cmake_policy(POP)
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake
index e3f8f5e..c39eb47 100644
--- a/Modules/Internal/CPack/CPackRPM.cmake
+++ b/Modules/Internal/CPack/CPackRPM.cmake
@@ -1088,7 +1088,17 @@
execute_process(
COMMAND "${RPMBUILD_EXECUTABLE}" --querytags
OUTPUT_VARIABLE RPMBUILD_TAG_LIST
+ RESULT_VARIABLE RPMBUILD_QUERYTAGS_SUCCESS
+ ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ # In some versions of RPM, rpmbuild does not understand --querytags parameter,
+ # but rpm does.
+ if(NOT RPMBUILD_QUERYTAGS_SUCCESS EQUAL 0)
+ execute_process(
+ COMMAND "${RPM_EXECUTABLE}" --querytags
+ OUTPUT_VARIABLE RPMBUILD_TAG_LIST
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif()
string(REPLACE "\n" ";" RPMBUILD_TAG_LIST "${RPMBUILD_TAG_LIST}")
# In some versions of RPM, weak dependency tags are present in the --querytags
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index bc4de91..d6510f3 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -394,8 +394,6 @@
#]=======================================================================]
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
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 047105c..373e695 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -548,8 +548,6 @@
cmBreakCommand.h
cmBuildCommand.cxx
cmBuildCommand.h
- cmBuildNameCommand.cxx
- cmBuildNameCommand.h
cmCMakeHostSystemInformationCommand.cxx
cmCMakeHostSystemInformationCommand.h
cmCMakeLanguageCommand.cxx
@@ -588,8 +586,6 @@
cmExperimental.h
cmExportCommand.cxx
cmExportCommand.h
- cmExportLibraryDependenciesCommand.cxx
- cmExportLibraryDependenciesCommand.h
cmFLTKWrapUICommand.cxx
cmFLTKWrapUICommand.h
cmFileCommand.cxx
@@ -668,8 +664,6 @@
cmListCommand.h
cmLoadCacheCommand.cxx
cmLoadCacheCommand.h
- cmLoadCommandCommand.cxx
- cmLoadCommandCommand.h
cmMacroCommand.cxx
cmMacroCommand.h
cmMakeDirectoryCommand.cxx
@@ -683,8 +677,6 @@
cmMessageMetadata.h
cmOptionCommand.cxx
cmOptionCommand.h
- cmOutputRequiredFilesCommand.cxx
- cmOutputRequiredFilesCommand.h
cmParseArgumentsCommand.cxx
cmParseArgumentsCommand.h
cmPathLabel.cxx
@@ -730,8 +722,6 @@
cmSubcommandTable.h
cmSubdirCommand.cxx
cmSubdirCommand.h
- cmSubdirDependsCommand.cxx
- cmSubdirDependsCommand.h
cmTargetCompileDefinitionsCommand.cxx
cmTargetCompileDefinitionsCommand.h
cmTargetCompileFeaturesCommand.cxx
@@ -760,12 +750,6 @@
cmTryRunCommand.h
cmUnsetCommand.cxx
cmUnsetCommand.h
- cmUseMangledMesaCommand.cxx
- cmUseMangledMesaCommand.h
- cmUtilitySourceCommand.cxx
- cmUtilitySourceCommand.h
- cmVariableRequiresCommand.cxx
- cmVariableRequiresCommand.h
cmVariableWatchCommand.cxx
cmVariableWatchCommand.h
cmWhileCommand.cxx
@@ -1385,7 +1369,5 @@
install(TARGETS ${_tool} DESTINATION ${CMAKE_BIN_DIR} ${COMPONENT})
endforeach()
-install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include)
-
# Unset temporary variables
unset(_tools)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 7bfddba..0998319 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 31)
-set(CMake_VERSION_PATCH 20250117)
+set(CMake_VERSION_PATCH 20250121)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 3a2db59..d8e1412 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -62,6 +62,7 @@
DoingOutput,
DoingSource,
DoingLanguage,
+ DoingTargetLabels,
DoingTargetName,
DoingTargetType,
DoingCommandType,
@@ -84,6 +85,8 @@
doing = DoingSource;
} else if (strcmp(arg, "--language") == 0) {
doing = DoingLanguage;
+ } else if (strcmp(arg, "--target-labels") == 0) {
+ doing = DoingTargetLabels;
} else if (strcmp(arg, "--target-name") == 0) {
doing = DoingTargetName;
} else if (strcmp(arg, "--target-type") == 0) {
@@ -106,6 +109,9 @@
this->Reporter.OptionLanguage = "C++";
}
doing = DoingNone;
+ } else if (doing == DoingTargetLabels) {
+ this->Reporter.OptionTargetLabels = arg;
+ doing = DoingNone;
} else if (doing == DoingTargetName) {
this->Reporter.OptionTargetName = arg;
doing = DoingNone;
@@ -257,6 +263,7 @@
options["role"] = this->Reporter.OptionRole;
std::map<std::string, std::string> arrayOptions;
arrayOptions["outputs"] = this->Reporter.OptionOutput;
+ arrayOptions["targetLabels"] = this->Reporter.OptionTargetLabels;
instrumenter.InstrumentCommand(
this->Reporter.OptionCommandType, this->RealArgV,
[this]() -> int {
diff --git a/Source/CTest/cmCTestLaunchReporter.h b/Source/CTest/cmCTestLaunchReporter.h
index 16f1461..e5a2d5b 100644
--- a/Source/CTest/cmCTestLaunchReporter.h
+++ b/Source/CTest/cmCTestLaunchReporter.h
@@ -34,6 +34,7 @@
std::string OptionOutput;
std::string OptionSource;
std::string OptionLanguage;
+ std::string OptionTargetLabels;
std::string OptionTargetName;
std::string OptionTargetType;
std::string OptionBuildDir;
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 3495aed..abf3b0b 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -298,15 +298,20 @@
symbol.find("$entry_thunk") == std::string::npos &&
symbol.find("$iexit_thunk") == std::string::npos &&
symbol.find("$exit_thunk") == std::string::npos)) {
- if (!pSymbolTable->Type && (SectChar & IMAGE_SCN_MEM_WRITE)) {
- // Read only (i.e. constants) must be excluded
+ if ((!pSymbolTable->Type &&
+ // Read only (i.e. constants) must be excluded
+ (SectChar & IMAGE_SCN_MEM_WRITE)) ||
+ (this->SymbolArch == Arch::ARM64EC &&
+ // vftable symbols are DATA on ARM64EC
+ symbol.compare(0, 4, vftablePrefix) == 0)) {
this->DataSymbols.insert(symbol);
- } else {
- if (pSymbolTable->Type || !(SectChar & IMAGE_SCN_MEM_READ) ||
- (SectChar & IMAGE_SCN_MEM_EXECUTE) ||
- (symbol.compare(0, 4, vftablePrefix) == 0)) {
- this->Symbols.insert(symbol);
- }
+ } else if (pSymbolTable->Type ||
+ !(SectChar & IMAGE_SCN_MEM_READ) ||
+ (SectChar & IMAGE_SCN_MEM_EXECUTE) ||
+ (this->SymbolArch != Arch::ARM64EC &&
+ // vftable symbols fail if marked as DATA
+ symbol.compare(0, 4, vftablePrefix) == 0)) {
+ this->Symbols.insert(symbol);
}
}
}
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 10e7a26..accc7ca 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -5,7 +5,6 @@
#include <algorithm>
#include <iterator>
#include <set>
-#include <sstream>
#include <unordered_set>
#include <utility>
@@ -590,44 +589,10 @@
cc->SetImplicitDepends(implicit_depends);
mf.AddCustomCommandToOutput(std::move(cc));
} else {
- if (!byproducts.empty()) {
- status.SetError(
- "BYPRODUCTS may not be specified with SOURCE signatures");
- return false;
- }
-
- if (uses_terminal) {
- status.SetError("USES_TERMINAL may not be used with SOURCE signatures");
- return false;
- }
-
- bool issueMessage = true;
- std::ostringstream e;
- MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (mf.GetPolicyStatus(cmPolicies::CMP0050)) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0050) << "\n";
- break;
- case cmPolicies::OLD:
- issueMessage = false;
- break;
- case cmPolicies::NEW:
- messageType = MessageType::FATAL_ERROR;
- break;
- }
-
- if (issueMessage) {
- e << "The SOURCE signatures of add_custom_command are no longer "
- "supported.";
- mf.IssueMessage(messageType, e.str());
- if (messageType == MessageType::FATAL_ERROR) {
- return false;
- }
- }
-
- // Use the old-style mode for backward compatibility.
- mf.AddCustomCommandOldStyle(target, outputs, depends, source, commandLines,
- comment);
+ mf.IssueMessage(
+ MessageType::FATAL_ERROR,
+ "The SOURCE signatures of add_custom_command are no longer supported.");
+ return false;
}
return true;
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 711eaa5..61762d6 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -13,7 +13,6 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
-#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
@@ -163,23 +162,11 @@
}
}
- std::string::size_type pos = targetName.find_first_of("#<>");
- if (pos != std::string::npos) {
- status.SetError(cmStrCat("called with target name containing a \"",
- targetName[pos],
- "\". This character is not allowed."));
- return false;
- }
-
- // Some requirements on custom target names already exist
- // and have been checked at this point.
- // The following restrictions overlap but depend on policy CMP0037.
bool nameOk = cmGeneratorExpression::IsValidTargetName(targetName) &&
- !cmGlobalGenerator::IsReservedTarget(targetName);
- if (nameOk) {
- nameOk = targetName.find(':') == std::string::npos;
- }
- if (!nameOk && !mf.CheckCMP0037(targetName, cmStateEnums::UTILITY)) {
+ !cmGlobalGenerator::IsReservedTarget(targetName) &&
+ targetName.find(':') == std::string::npos;
+ if (!nameOk) {
+ mf.IssueInvalidTargetNameError(targetName);
return false;
}
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index 16a8965..2c7e3a0 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -64,7 +64,8 @@
if (nameOk && !importTarget && !isAlias) {
nameOk = exename.find(':') == std::string::npos;
}
- if (!nameOk && !mf.CheckCMP0037(exename, cmStateEnums::EXECUTABLE)) {
+ if (!nameOk) {
+ mf.IssueInvalidTargetNameError(exename);
return false;
}
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index e2a52d1..037ac03 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -150,7 +150,8 @@
if (nameOk && !importTarget && !isAlias) {
nameOk = libName.find(':') == std::string::npos;
}
- if (!nameOk && !mf.CheckCMP0037(libName, type)) {
+ if (!nameOk) {
+ mf.IssueInvalidTargetNameError(libName);
return false;
}
diff --git a/Source/cmArgumentParserTypes.h b/Source/cmArgumentParserTypes.h
index 3e0fae4..e89c940 100644
--- a/Source/cmArgumentParserTypes.h
+++ b/Source/cmArgumentParserTypes.h
@@ -21,6 +21,13 @@
template <typename T>
struct MaybeEmpty;
+# if defined(__LCC__) && (__EDG_VERSION__ >= 603)
+template <>
+struct MaybeEmpty<std::vector<std::string>> : public std::vector<std::string>
+{
+ using std::vector<std::string>::vector;
+};
+# endif
template <typename T>
struct MaybeEmpty<std::vector<T>> : public std::vector<T>
{
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
deleted file mode 100644
index 20d6089..0000000
--- a/Source/cmBuildNameCommand.cxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmBuildNameCommand.h"
-
-#include <algorithm>
-
-#include "cmsys/RegularExpression.hxx"
-
-#include "cmExecutionStatus.h"
-#include "cmMakefile.h"
-#include "cmStateTypes.h"
-#include "cmSystemTools.h"
-#include "cmValue.h"
-
-bool cmBuildNameCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status)
-{
- if (args.empty()) {
- status.SetError("called with incorrect number of arguments");
- return false;
- }
- cmMakefile& mf = status.GetMakefile();
- cmValue cacheValue = mf.GetDefinition(args[0]);
- if (cacheValue) {
- // do we need to correct the value?
- cmsys::RegularExpression reg("[()/]");
- std::string cv = *cacheValue;
- if (reg.find(cv)) {
- std::replace(cv.begin(), cv.end(), '/', '_');
- std::replace(cv.begin(), cv.end(), '(', '_');
- std::replace(cv.begin(), cv.end(), ')', '_');
- mf.AddCacheDefinition(args[0], cv, "Name of build.",
- cmStateEnums::STRING);
- }
- return true;
- }
-
- std::string buildname = "WinNT";
- if (mf.GetDefinition("UNIX")) {
- buildname.clear();
- cmSystemTools::RunSingleCommand("uname -a", &buildname, &buildname);
- if (!buildname.empty()) {
- std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) ";
- cmsys::RegularExpression reg(RegExp);
- if (reg.find(buildname)) {
- buildname = reg.match(1) + "-" + reg.match(2);
- }
- }
- }
- std::string compiler = "${CMAKE_CXX_COMPILER}";
- mf.ExpandVariablesInString(compiler);
- buildname += "-";
- buildname += cmSystemTools::GetFilenameName(compiler);
- std::replace(buildname.begin(), buildname.end(), '/', '_');
- std::replace(buildname.begin(), buildname.end(), '(', '_');
- std::replace(buildname.begin(), buildname.end(), ')', '_');
-
- mf.AddCacheDefinition(args[0], buildname, "Name of build.",
- cmStateEnums::STRING);
- return true;
-}
diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h
deleted file mode 100644
index 650dc74..0000000
--- a/Source/cmBuildNameCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmBuildNameCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx
index 9035254..81050e6 100644
--- a/Source/cmCMakePolicyCommand.cxx
+++ b/Source/cmCMakePolicyCommand.cxx
@@ -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 @@
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;
}
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
deleted file mode 100644
index 6f101cb..0000000
--- a/Source/cmCPluginAPI.cxx
+++ /dev/null
@@ -1,874 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-/*
- this file contains the implementation of the C API to CMake. Generally
- these routines just manipulate arguments and then call the associated
- methods on the CMake classes. */
-
-#include "cmCPluginAPI.h"
-
-#include <cstdlib>
-
-#include "cmExecutionStatus.h"
-#include "cmGlobalGenerator.h"
-#include "cmMakefile.h"
-#include "cmSourceFile.h"
-#include "cmState.h"
-#include "cmValue.h"
-#include "cmVersion.h"
-
-#ifdef __QNX__
-# include <malloc.h> /* for malloc/free on QNX */
-#endif
-
-extern "C" {
-
-static void CCONV* cmGetClientData(void* info)
-{
- return ((cmLoadedCommandInfo*)info)->ClientData;
-}
-
-static void CCONV cmSetClientData(void* info, void* cd)
-{
- ((cmLoadedCommandInfo*)info)->ClientData = cd;
-}
-
-static void CCONV cmSetError(void* info, const char* err)
-{
- if (((cmLoadedCommandInfo*)info)->Error) {
- free(((cmLoadedCommandInfo*)info)->Error);
- }
- ((cmLoadedCommandInfo*)info)->Error = strdup(err);
-}
-
-static unsigned int CCONV cmGetCacheMajorVersion(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- cmState* state = mf->GetState();
- return state->GetCacheMajorVersion();
-}
-static unsigned int CCONV cmGetCacheMinorVersion(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- cmState* state = mf->GetState();
- return state->GetCacheMinorVersion();
-}
-
-static unsigned int CCONV cmGetMajorVersion(void*)
-{
- return cmVersion::GetMajorVersion();
-}
-
-static unsigned int CCONV cmGetMinorVersion(void*)
-{
- return cmVersion::GetMinorVersion();
-}
-
-static void CCONV cmAddDefinition(void* arg, const char* name,
- const char* value)
-{
- if (value) {
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- mf->AddDefinition(name, value);
- }
-}
-
-/* Add a definition to this makefile and the global cmake cache. */
-static void CCONV cmAddCacheDefinition(void* arg, const char* name,
- const char* value, const char* doc,
- int type)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- std::string valueString;
- std::string docString;
- cmValue v;
- cmValue d;
- if (value != nullptr) {
- valueString = value;
- v = cmValue{ valueString };
- }
- if (doc != nullptr) {
- docString = doc;
- d = cmValue{ docString };
- }
-
- switch (type) {
- case CM_CACHE_BOOL:
- mf->AddCacheDefinition(name, v, d, cmStateEnums::BOOL);
- break;
- case CM_CACHE_PATH:
- mf->AddCacheDefinition(name, v, d, cmStateEnums::PATH);
- break;
- case CM_CACHE_FILEPATH:
- mf->AddCacheDefinition(name, v, d, cmStateEnums::FILEPATH);
- break;
- case CM_CACHE_STRING:
- mf->AddCacheDefinition(name, v, d, cmStateEnums::STRING);
- break;
- case CM_CACHE_INTERNAL:
- mf->AddCacheDefinition(name, v, d, cmStateEnums::INTERNAL);
- break;
- case CM_CACHE_STATIC:
- mf->AddCacheDefinition(name, v, d, cmStateEnums::STATIC);
- break;
- }
-}
-
-static const char* CCONV cmGetProjectName(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- static std::string name;
- name = mf->GetStateSnapshot().GetProjectName();
- return name.c_str();
-}
-
-static const char* CCONV cmGetHomeDirectory(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetHomeDirectory().c_str();
-}
-static const char* CCONV cmGetHomeOutputDirectory(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetHomeOutputDirectory().c_str();
-}
-static const char* CCONV cmGetStartDirectory(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetCurrentSourceDirectory().c_str();
-}
-static const char* CCONV cmGetStartOutputDirectory(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetCurrentBinaryDirectory().c_str();
-}
-static const char* CCONV cmGetCurrentDirectory(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetCurrentSourceDirectory().c_str();
-}
-static const char* CCONV cmGetCurrentOutputDirectory(void* arg)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetCurrentBinaryDirectory().c_str();
-}
-static const char* CCONV cmGetDefinition(void* arg, const char* def)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetDefinition(def).GetCStr();
-}
-
-static int CCONV cmIsOn(void* arg, const char* name)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return static_cast<int>(mf->IsOn(name));
-}
-
-/** Check if a command exists. */
-static int CCONV cmCommandExists(void* arg, const char* name)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- return mf->GetState()->GetCommand(name) ? 1 : 0;
-}
-
-static void CCONV cmAddDefineFlag(void* arg, const char* definition)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- mf->AddDefineFlag(definition);
-}
-
-static void CCONV cmAddLinkDirectoryForTarget(void* arg, const char* tgt,
- const char* d)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- cmTarget* t = mf->FindLocalNonAliasTarget(tgt);
- if (!t) {
- cmSystemTools::Error(
- "Attempt to add link directories to non-existent target: " +
- std::string(tgt) + " for directory " + std::string(d));
- return;
- }
- t->InsertLinkDirectory(BT<std::string>(d, mf->GetBacktrace()));
-}
-
-static void CCONV cmAddExecutable(void* arg, const char* exename, int numSrcs,
- const char** srcs, int win32)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- std::vector<std::string> srcs2;
- int i;
- for (i = 0; i < numSrcs; ++i) {
- srcs2.emplace_back(srcs[i]);
- }
- cmTarget* tg = mf->AddExecutable(exename, srcs2);
- if (win32) {
- tg->SetProperty("WIN32_EXECUTABLE", "ON");
- }
-}
-
-static void CCONV cmAddUtilityCommand(void* arg, const char* utilityName,
- const char* command,
- const char* arguments, int all,
- int numDepends, const char** depends,
- int, const char**)
-{
- // Get the makefile instance. Perform an extra variable expansion
- // now because the API caller expects it.
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
-
- // Construct the command line for the command.
- cmCustomCommandLine commandLine;
- std::string expand = command;
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- if (arguments && arguments[0]) {
- // TODO: Parse arguments!
- expand = arguments;
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- }
- cmCustomCommandLines commandLines;
- commandLines.push_back(commandLine);
-
- // Accumulate the list of dependencies.
- std::vector<std::string> depends2;
- for (int i = 0; i < numDepends; ++i) {
- expand = depends[i];
- depends2.push_back(mf->ExpandVariablesInString(expand));
- }
-
- // Pass the call to the makefile instance.
- auto cc = cm::make_unique<cmCustomCommand>();
- cc->SetDepends(depends2);
- cc->SetCommandLines(commandLines);
- mf->AddUtilityCommand(utilityName, !all, std::move(cc));
-}
-
-static void CCONV cmAddCustomCommand(void* arg, const char* source,
- const char* command, int numArgs,
- const char** args, int numDepends,
- const char** depends, int numOutputs,
- const char** outputs, const char* target)
-{
- // Get the makefile instance. Perform an extra variable expansion
- // now because the API caller expects it.
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
-
- // Construct the command line for the command.
- cmCustomCommandLine commandLine;
- std::string expand = command;
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- for (int i = 0; i < numArgs; ++i) {
- expand = args[i];
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- }
- cmCustomCommandLines commandLines;
- commandLines.push_back(commandLine);
-
- // Accumulate the list of dependencies.
- std::vector<std::string> depends2;
- for (int i = 0; i < numDepends; ++i) {
- expand = depends[i];
- depends2.push_back(mf->ExpandVariablesInString(expand));
- }
-
- // Accumulate the list of outputs.
- std::vector<std::string> outputs2;
- for (int i = 0; i < numOutputs; ++i) {
- expand = outputs[i];
- outputs2.push_back(mf->ExpandVariablesInString(expand));
- }
-
- // Pass the call to the makefile instance.
- const char* no_comment = nullptr;
- mf->AddCustomCommandOldStyle(target, outputs2, depends2, source,
- commandLines, no_comment);
-}
-
-static void CCONV cmAddCustomCommandToOutput(void* arg, const char* output,
- const char* command, int numArgs,
- const char** args,
- const char* main_dependency,
- int numDepends,
- const char** depends)
-{
- // Get the makefile instance. Perform an extra variable expansion
- // now because the API caller expects it.
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
-
- // Construct the command line for the command.
- cmCustomCommandLine commandLine;
- std::string expand = command;
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- for (int i = 0; i < numArgs; ++i) {
- expand = args[i];
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- }
- cmCustomCommandLines commandLines;
- commandLines.push_back(commandLine);
-
- // Accumulate the list of dependencies.
- std::vector<std::string> depends2;
- for (int i = 0; i < numDepends; ++i) {
- expand = depends[i];
- depends2.push_back(mf->ExpandVariablesInString(expand));
- }
-
- // Pass the call to the makefile instance.
- auto cc = cm::make_unique<cmCustomCommand>();
- cc->SetOutputs(output);
- cc->SetMainDependency(main_dependency);
- cc->SetDepends(depends2);
- cc->SetCommandLines(commandLines);
- mf->AddCustomCommandToOutput(std::move(cc));
-}
-
-static void CCONV cmAddCustomCommandToTarget(void* arg, const char* target,
- const char* command, int numArgs,
- const char** args,
- int commandType)
-{
- // Get the makefile instance.
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
-
- // Construct the command line for the command. Perform an extra
- // variable expansion now because the API caller expects it.
- cmCustomCommandLine commandLine;
- std::string expand = command;
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- for (int i = 0; i < numArgs; ++i) {
- expand = args[i];
- commandLine.push_back(mf->ExpandVariablesInString(expand));
- }
- cmCustomCommandLines commandLines;
- commandLines.push_back(commandLine);
-
- // Select the command type.
- cmCustomCommandType cctype = cmCustomCommandType::POST_BUILD;
- switch (commandType) {
- case CM_PRE_BUILD:
- cctype = cmCustomCommandType::PRE_BUILD;
- break;
- case CM_PRE_LINK:
- cctype = cmCustomCommandType::PRE_LINK;
- break;
- case CM_POST_BUILD:
- cctype = cmCustomCommandType::POST_BUILD;
- break;
- }
-
- // Pass the call to the makefile instance.
- auto cc = cm::make_unique<cmCustomCommand>();
- cc->SetCommandLines(commandLines);
- mf->AddCustomCommandToTarget(target, cctype, std::move(cc));
-}
-
-static void addLinkLibrary(cmMakefile* mf, std::string const& target,
- std::string const& lib, cmTargetLinkLibraryType llt)
-{
- cmTarget* t = mf->FindLocalNonAliasTarget(target);
- if (!t) {
- std::ostringstream e;
- e << "Attempt to add link library \"" << lib << "\" to target \"" << target
- << "\" which is not built in this directory.";
- mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
- }
-
- cmTarget* tgt = mf->GetGlobalGenerator()->FindTarget(lib);
- if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) &&
- (tgt->GetType() != cmStateEnums::SHARED_LIBRARY) &&
- (tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) &&
- !tgt->IsExecutableWithExports()) {
- std::ostringstream e;
- e << "Target \"" << lib << "\" of type "
- << cmState::GetTargetTypeName(tgt->GetType())
- << " may not be linked into another target. "
- << "One may link only to STATIC or SHARED libraries, or "
- << "to executables with the ENABLE_EXPORTS property set.";
- mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
- }
-
- t->AddLinkLibrary(*mf, lib, llt);
-}
-
-static void CCONV cmAddLinkLibraryForTarget(void* arg, const char* tgt,
- const char* value, int libtype)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
-
- switch (libtype) {
- case CM_LIBRARY_GENERAL:
- addLinkLibrary(mf, tgt, value, GENERAL_LibraryType);
- break;
- case CM_LIBRARY_DEBUG:
- addLinkLibrary(mf, tgt, value, DEBUG_LibraryType);
- break;
- case CM_LIBRARY_OPTIMIZED:
- addLinkLibrary(mf, tgt, value, OPTIMIZED_LibraryType);
- break;
- }
-}
-
-static void CCONV cmAddLibrary(void* arg, const char* libname, int shared,
- int numSrcs, const char** srcs)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- std::vector<std::string> srcs2;
- int i;
- for (i = 0; i < numSrcs; ++i) {
- srcs2.emplace_back(srcs[i]);
- }
- mf->AddLibrary(
- libname,
- (shared ? cmStateEnums::SHARED_LIBRARY : cmStateEnums::STATIC_LIBRARY),
- srcs2);
-}
-
-static char CCONV* cmExpandVariablesInString(void* arg, const char* source,
- int escapeQuotes, int atOnly)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- std::string barf = source;
- std::string const& result =
- mf->ExpandVariablesInString(barf, escapeQuotes != 0, atOnly != 0);
- return strdup(result.c_str());
-}
-
-static int CCONV cmExecuteCommand(void* arg, const char* name, int numArgs,
- const char** args)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
-
- std::vector<cmListFileArgument> lffArgs;
- lffArgs.reserve(numArgs);
- for (int i = 0; i < numArgs; ++i) {
- // Assume all arguments are quoted.
- lffArgs.emplace_back(args[i], cmListFileArgument::Quoted, 0);
- }
-
- cmListFileFunction lff{ name, 0, 0, std::move(lffArgs) };
- cmExecutionStatus status(*mf);
- return mf->ExecuteCommand(lff, status);
-}
-
-static void CCONV cmExpandSourceListArguments(void* arg, int numArgs,
- const char** args, int* resArgc,
- char*** resArgv,
- unsigned int startArgumentIndex)
-{
- (void)arg;
- (void)startArgumentIndex;
- std::vector<std::string> result;
- int i;
- for (i = 0; i < numArgs; ++i) {
- result.emplace_back(args[i]);
- }
- int resargc = static_cast<int>(result.size());
- char** resargv = nullptr;
- if (resargc) {
- resargv = (char**)malloc(resargc * sizeof(char*));
- }
- for (i = 0; i < resargc; ++i) {
- resargv[i] = strdup(result[i].c_str());
- }
- *resArgc = resargc;
- *resArgv = resargv;
-}
-
-static void CCONV cmFreeArguments(int argc, char** argv)
-{
- int i;
- for (i = 0; i < argc; ++i) {
- free(argv[i]);
- }
- free(argv);
-}
-
-static int CCONV cmGetTotalArgumentSize(int argc, char** argv)
-{
- int i;
- int result = 0;
- for (i = 0; i < argc; ++i) {
- if (argv[i]) {
- result = result + static_cast<int>(strlen(argv[i]));
- }
- }
- return result;
-}
-
-// Source file proxy object to support the old cmSourceFile/cmMakefile
-// API for source files.
-struct cmCPluginAPISourceFile
-{
- cmSourceFile* RealSourceFile = nullptr;
- std::string SourceName;
- std::string SourceExtension;
- std::string FullPath;
- std::vector<std::string> Depends;
- cmPropertyMap Properties;
-};
-
-// Keep a map from real cmSourceFile instances stored in a makefile to
-// the CPluginAPI proxy source file.
-using cmCPluginAPISourceFileMap =
- std::map<cmSourceFile*, std::unique_ptr<cmCPluginAPISourceFile>>;
-static cmCPluginAPISourceFileMap cmCPluginAPISourceFiles;
-
-static void* CCONV cmCreateSourceFile()
-{
- return new cmCPluginAPISourceFile;
-}
-
-static void* CCONV cmCreateNewSourceFile(void*)
-{
- return new cmCPluginAPISourceFile;
-}
-
-static void CCONV cmDestroySourceFile(void* arg)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- // Only delete if it was created by cmCreateSourceFile or
- // cmCreateNewSourceFile and is therefore not in the map.
- if (!sf->RealSourceFile) {
- delete sf;
- }
-}
-
-static void CCONV* cmGetSource(void* arg, const char* name)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- if (cmSourceFile* rsf = mf->GetSource(name)) {
- // Lookup the proxy source file object for this source.
- auto i = cmCPluginAPISourceFiles.find(rsf);
- if (i == cmCPluginAPISourceFiles.end()) {
- // Create a proxy source file object for this source.
- auto sf = cm::make_unique<cmCPluginAPISourceFile>();
- sf->RealSourceFile = rsf;
- sf->FullPath = rsf->ResolveFullPath();
- sf->SourceName =
- cmSystemTools::GetFilenameWithoutLastExtension(sf->FullPath);
- sf->SourceExtension =
- cmSystemTools::GetFilenameLastExtension(sf->FullPath);
-
- // Store the proxy in the map so it can be reused and deleted later.
- i = cmCPluginAPISourceFiles.emplace(rsf, std::move(sf)).first;
- }
- return i->second.get();
- }
- return nullptr;
-}
-
-static void* CCONV cmAddSource(void* arg, void* arg2)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- cmCPluginAPISourceFile* osf = static_cast<cmCPluginAPISourceFile*>(arg2);
- if (osf->FullPath.empty()) {
- return nullptr;
- }
-
- // Create the real cmSourceFile instance and copy over saved information.
- cmSourceFile* rsf = mf->GetOrCreateSource(osf->FullPath);
- rsf->SetProperties(osf->Properties);
- // In case the properties contain the GENERATED property,
- // mark the real cmSourceFile as generated.
- if (rsf->GetIsGenerated()) {
- rsf->MarkAsGenerated();
- }
- for (std::string const& d : osf->Depends) {
- rsf->AddDepend(d);
- }
-
- // Create the proxy for the real source file.
- auto sf = cm::make_unique<cmCPluginAPISourceFile>();
- sf->RealSourceFile = rsf;
- sf->FullPath = osf->FullPath;
- sf->SourceName = osf->SourceName;
- sf->SourceExtension = osf->SourceExtension;
-
- // Store the proxy in the map so it can be reused and deleted later.
- auto* value = sf.get();
- cmCPluginAPISourceFiles[rsf] = std::move(sf);
- return value;
-}
-
-static const char* CCONV cmSourceFileGetSourceName(void* arg)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- return sf->SourceName.c_str();
-}
-
-static const char* CCONV cmSourceFileGetFullPath(void* arg)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- return sf->FullPath.c_str();
-}
-
-static const char* CCONV cmSourceFileGetProperty(void* arg, const char* prop)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- if (cmSourceFile* rsf = sf->RealSourceFile) {
- return rsf->GetProperty(prop).GetCStr();
- }
- if (!strcmp(prop, "LOCATION")) {
- return sf->FullPath.c_str();
- }
- return sf->Properties.GetPropertyValue(prop).GetCStr();
-}
-
-static int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- if (cmSourceFile* rsf = sf->RealSourceFile) {
- return rsf->GetPropertyAsBool(prop) ? 1 : 0;
- }
- return cmIsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
-}
-
-static void CCONV cmSourceFileSetProperty(void* arg, const char* prop,
- const char* value)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- if (cmSourceFile* rsf = sf->RealSourceFile) {
- if (!value) {
- rsf->RemoveProperty(prop);
- } else {
- rsf->SetProperty(prop, value);
- }
- } else if (prop) {
- if (!value) {
- value = "NOTFOUND";
- }
- sf->Properties.SetProperty(prop, value);
- }
-}
-
-static void CCONV cmSourceFileAddDepend(void* arg, const char* depend)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- if (cmSourceFile* rsf = sf->RealSourceFile) {
- rsf->AddDepend(depend);
- } else {
- sf->Depends.emplace_back(depend);
- }
-}
-
-static void CCONV cmSourceFileSetName(void* arg, const char* name,
- const char* dir, int numSourceExtensions,
- const char** sourceExtensions,
- int numHeaderExtensions,
- const char** headerExtensions)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- if (sf->RealSourceFile) {
- // SetName is allowed only on temporary source files created by
- // the command for building and passing to AddSource.
- return;
- }
- std::vector<std::string> sourceExts;
- std::vector<std::string> headerExts;
- int i;
- for (i = 0; i < numSourceExtensions; ++i) {
- sourceExts.emplace_back(sourceExtensions[i]);
- }
- for (i = 0; i < numHeaderExtensions; ++i) {
- headerExts.emplace_back(headerExtensions[i]);
- }
-
- // Save the original name given.
- sf->SourceName = name;
-
- // Convert the name to a full path in case the given name is a
- // relative path.
- std::string pathname = cmSystemTools::CollapseFullPath(name, dir);
-
- // First try and see whether the listed file can be found
- // as is without extensions added on.
- std::string hname = pathname;
- if (cmSystemTools::FileExists(hname)) {
- sf->SourceName = cmSystemTools::GetFilenamePath(name);
- if (!sf->SourceName.empty()) {
- sf->SourceName += "/";
- }
- sf->SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name);
- std::string::size_type pos = hname.rfind('.');
- if (pos != std::string::npos) {
- sf->SourceExtension = hname.substr(pos + 1, hname.size() - pos);
- if (cmSystemTools::FileIsFullPath(name)) {
- std::string::size_type pos2 = hname.rfind('/');
- if (pos2 != std::string::npos) {
- sf->SourceName = hname.substr(pos2 + 1, pos - pos2 - 1);
- }
- }
- }
-
- sf->FullPath = hname;
- return;
- }
-
- // Next, try the various source extensions
- for (std::string const& ext : sourceExts) {
- hname = cmStrCat(pathname, '.', ext);
- if (cmSystemTools::FileExists(hname)) {
- sf->SourceExtension = ext;
- sf->FullPath = hname;
- return;
- }
- }
-
- // Finally, try the various header extensions
- for (std::string const& ext : headerExts) {
- hname = cmStrCat(pathname, '.', ext);
- if (cmSystemTools::FileExists(hname)) {
- sf->SourceExtension = ext;
- sf->FullPath = hname;
- return;
- }
- }
-
- std::ostringstream e;
- e << "Cannot find source file \"" << pathname << "\"";
- e << "\n\nTried extensions";
- for (std::string const& ext : sourceExts) {
- e << " ." << ext;
- }
- for (std::string const& ext : headerExts) {
- e << " ." << ext;
- }
- cmSystemTools::Error(e.str());
-}
-
-static void CCONV cmSourceFileSetName2(void* arg, const char* name,
- const char* dir, const char* ext,
- int headerFileOnly)
-{
- cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
- if (sf->RealSourceFile) {
- // SetName is allowed only on temporary source files created by
- // the command for building and passing to AddSource.
- return;
- }
-
- // Implement the old SetName method code here.
- if (headerFileOnly) {
- sf->Properties.SetProperty("HEADER_FILE_ONLY", "1");
- }
- sf->SourceName = name;
- std::string fname = sf->SourceName;
- if (cmNonempty(ext)) {
- fname += ".";
- fname += ext;
- }
- sf->FullPath = cmSystemTools::CollapseFullPath(fname, dir);
- cmSystemTools::ConvertToUnixSlashes(sf->FullPath);
- sf->SourceExtension = ext;
-}
-
-static char* CCONV cmGetFilenameWithoutExtension(const char* name)
-{
- std::string sres = cmSystemTools::GetFilenameWithoutExtension(name);
- return strdup(sres.c_str());
-}
-
-static char* CCONV cmGetFilenamePath(const char* name)
-{
- std::string sres = cmSystemTools::GetFilenamePath(name);
- return strdup(sres.c_str());
-}
-
-static char* CCONV cmCapitalized(const char* name)
-{
- std::string sres = cmSystemTools::Capitalized(name);
- return strdup(sres.c_str());
-}
-
-static void CCONV cmCopyFileIfDifferent(const char* name1, const char* name2)
-{
- cmSystemTools::CopyFileIfDifferent(name1, name2);
-}
-
-static void CCONV cmRemoveFile(const char* name)
-{
- cmSystemTools::RemoveFile(name);
-}
-
-static void CCONV cmDisplayStatus(void* arg, const char* message)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- mf->DisplayStatus(message, -1);
-}
-
-static void CCONV cmFree(void* data)
-{
- free(data);
-}
-
-static void CCONV DefineSourceFileProperty(void* arg, const char* name,
- const char* briefDocs,
- const char* longDocs, int chained)
-{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- mf->GetState()->DefineProperty(name, cmProperty::SOURCE_FILE,
- briefDocs ? briefDocs : "",
- longDocs ? longDocs : "", chained != 0);
-}
-
-} // close the extern "C" scope
-
-static cmCAPI cmStaticCAPI = {
- cmGetClientData,
- cmGetTotalArgumentSize,
- cmFreeArguments,
- cmSetClientData,
- cmSetError,
- cmAddCacheDefinition,
- cmAddCustomCommand,
- cmAddDefineFlag,
- cmAddDefinition,
- cmAddExecutable,
- cmAddLibrary,
- cmAddLinkDirectoryForTarget,
- cmAddLinkLibraryForTarget,
- cmAddUtilityCommand,
- cmCommandExists,
- cmExecuteCommand,
- cmExpandSourceListArguments,
- cmExpandVariablesInString,
- cmGetCacheMajorVersion,
- cmGetCacheMinorVersion,
- cmGetCurrentDirectory,
- cmGetCurrentOutputDirectory,
- cmGetDefinition,
- cmGetHomeDirectory,
- cmGetHomeOutputDirectory,
- cmGetMajorVersion,
- cmGetMinorVersion,
- cmGetProjectName,
- cmGetStartDirectory,
- cmGetStartOutputDirectory,
- cmIsOn,
-
- cmAddSource,
- cmCreateSourceFile,
- cmDestroySourceFile,
- cmGetSource,
- cmSourceFileAddDepend,
- cmSourceFileGetProperty,
- cmSourceFileGetPropertyAsBool,
- cmSourceFileGetSourceName,
- cmSourceFileGetFullPath,
- cmSourceFileSetName,
- cmSourceFileSetName2,
- cmSourceFileSetProperty,
-
- cmCapitalized,
- cmCopyFileIfDifferent,
- cmGetFilenameWithoutExtension,
- cmGetFilenamePath,
- cmRemoveFile,
- cmFree,
-
- cmAddCustomCommandToOutput,
- cmAddCustomCommandToTarget,
- cmDisplayStatus,
- cmCreateNewSourceFile,
- DefineSourceFileProperty,
-};
diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h
deleted file mode 100644
index 92dff57..0000000
--- a/Source/cmCPluginAPI.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-/* This header file defines the API that loadable commands can use. In many
- of these commands C++ instances of cmMakefile of cmSourceFile are passed
- in as arguments or returned. In these cases they are passed as a void *
- argument. In the function prototypes mf is used to represent a makefile
- and sf is used to represent a source file. The functions are grouped
- loosely into four groups 1) Utility 2) cmMakefile 3) cmSourceFile 4)
- cmSystemTools. Within each grouping functions are listed alphabetically */
-/*=========================================================================*/
-#ifndef cmCPluginAPI_h /* NOLINT(cmake-use-pragma-once) */
-#define cmCPluginAPI_h
-
-#define CMAKE_VERSION_MAJOR 2
-#define CMAKE_VERSION_MINOR 5
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __WATCOMC__
-# define CCONV __cdecl
-#else
-# define CCONV
-#endif
-/*=========================================================================
-this is the structure of function entry points that a plugin may call. This
-structure must be kept in sync with the static decaled at the bottom of
-cmCPLuginAPI.cxx
-=========================================================================*/
-/* NOLINTNEXTLINE(modernize-use-using) */
-typedef struct
-{
- /*=========================================================================
- Here we define the set of functions that a plugin may call. The first group
- of functions are utility functions that are specific to the plugin API
- =========================================================================*/
- /* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how
- information is passed from the InitialPass to FinalPass for commands
- that need a FinalPass and need information from the InitialPass */
- void*(CCONV* GetClientData)(void* info);
- /* return the summed size in characters of all the arguments */
- int(CCONV* GetTotalArgumentSize)(int argc, char** argv);
- /* free all the memory associated with an argc, argv pair */
- void(CCONV* FreeArguments)(int argc, char** argv);
- /* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how
- information is passed from the InitialPass to FinalPass for commands
- that need a FinalPass and need information from the InitialPass */
- void(CCONV* SetClientData)(void* info, void* cd);
- /* when an error occurs, call this function to set the error string */
- void(CCONV* SetError)(void* info, const char* err);
-
- /*=========================================================================
- The following functions all directly map to methods in the cmMakefile
- class. See cmMakefile.h for descriptions of what each method does. All of
- these methods take the void * makefile pointer as their first argument.
- =========================================================================*/
- void(CCONV* AddCacheDefinition)(void* mf, const char* name,
- const char* value, const char* doc,
- int cachetype);
- void(CCONV* AddCustomCommand)(void* mf, const char* source,
- const char* command, int numArgs,
- const char** args, int numDepends,
- const char** depends, int numOutputs,
- const char** outputs, const char* target);
- void(CCONV* AddDefineFlag)(void* mf, const char* definition);
- void(CCONV* AddDefinition)(void* mf, const char* name, const char* value);
- void(CCONV* AddExecutable)(void* mf, const char* exename, int numSrcs,
- const char** srcs, int win32);
- void(CCONV* AddLibrary)(void* mf, const char* libname, int shared,
- int numSrcs, const char** srcs);
- void(CCONV* AddLinkDirectoryForTarget)(void* mf, const char* tgt,
- const char* d);
- void(CCONV* AddLinkLibraryForTarget)(void* mf, const char* tgt,
- const char* libname, int libtype);
- void(CCONV* AddUtilityCommand)(void* mf, const char* utilityName,
- const char* command, const char* arguments,
- int all, int numDepends, const char** depends,
- int numOutputs, const char** outputs);
- int(CCONV* CommandExists)(void* mf, const char* name);
- int(CCONV* ExecuteCommand)(void* mf, const char* name, int numArgs,
- const char** args);
- void(CCONV* ExpandSourceListArguments)(void* mf, int argc, const char** argv,
- int* resArgc, char*** resArgv,
- unsigned int startArgumentIndex);
- char*(CCONV* ExpandVariablesInString)(void* mf, const char* source,
- int escapeQuotes, int atOnly);
- unsigned int(CCONV* GetCacheMajorVersion)(void* mf);
- unsigned int(CCONV* GetCacheMinorVersion)(void* mf);
- const char*(CCONV* GetCurrentDirectory)(void* mf);
- const char*(CCONV* GetCurrentOutputDirectory)(void* mf);
- const char*(CCONV* GetDefinition)(void* mf, const char* def);
- const char*(CCONV* GetHomeDirectory)(void* mf);
- const char*(CCONV* GetHomeOutputDirectory)(void* mf);
- unsigned int(CCONV* GetMajorVersion)(void* mf);
- unsigned int(CCONV* GetMinorVersion)(void* mf);
- const char*(CCONV* GetProjectName)(void* mf);
- const char*(CCONV* GetStartDirectory)(void* mf);
- const char*(CCONV* GetStartOutputDirectory)(void* mf);
- int(CCONV* IsOn)(void* mf, const char* name);
-
- /*=========================================================================
- The following functions are designed to operate or manipulate
- cmSourceFiles. Please see cmSourceFile.h for additional information on many
- of these methods. Some of these methods are in cmMakefile.h.
- =========================================================================*/
- void*(CCONV* AddSource)(void* mf, void* sf);
- void*(CCONV* CreateSourceFile)();
- void(CCONV* DestroySourceFile)(void* sf);
- void*(CCONV* GetSource)(void* mf, const char* sourceName);
- void(CCONV* SourceFileAddDepend)(void* sf, const char* depend);
- const char*(CCONV* SourceFileGetProperty)(void* sf, const char* prop);
- int(CCONV* SourceFileGetPropertyAsBool)(void* sf, const char* prop);
- const char*(CCONV* SourceFileGetSourceName)(void* sf);
- const char*(CCONV* SourceFileGetFullPath)(void* sf);
- void(CCONV* SourceFileSetName)(void* sf, const char* name, const char* dir,
- int numSourceExtensions,
- const char** sourceExtensions,
- int numHeaderExtensions,
- const char** headerExtensions);
- void(CCONV* SourceFileSetName2)(void* sf, const char* name, const char* dir,
- const char* ext, int headerFileOnly);
- void(CCONV* SourceFileSetProperty)(void* sf, const char* prop,
- const char* value);
-
- /*=========================================================================
- The following methods are from cmSystemTools.h see that file for specific
- documentation on each method.
- =========================================================================*/
- char*(CCONV* Capitalized)(const char*);
- void(CCONV* CopyFileIfDifferent)(const char* f1, const char* f2);
- char*(CCONV* GetFilenameWithoutExtension)(const char*);
- char*(CCONV* GetFilenamePath)(const char*);
- void(CCONV* RemoveFile)(const char* f1);
- void(CCONV* Free)(void*);
-
- /*=========================================================================
- The following are new functions added after 1.6
- =========================================================================*/
- void(CCONV* AddCustomCommandToOutput)(void* mf, const char* output,
- const char* command, int numArgs,
- const char** args,
- const char* main_dependency,
- int numDepends, const char** depends);
- void(CCONV* AddCustomCommandToTarget)(void* mf, const char* target,
- const char* command, int numArgs,
- const char** args, int commandType);
-
- /* display status information */
- void(CCONV* DisplaySatus)(void* info, const char* message);
-
- /* new functions added after 2.4 */
- void*(CCONV* CreateNewSourceFile)(void* mf);
- void(CCONV* DefineSourceFileProperty)(void* mf, const char* name,
- const char* briefDocs,
- const char* longDocs, int chained);
-
- /* this is the end of the C function stub API structure */
-} cmCAPI;
-
-/*=========================================================================
-CM_PLUGIN_EXPORT should be used by plugins
-=========================================================================*/
-#ifdef _WIN32
-# define CM_PLUGIN_EXPORT __declspec(dllexport)
-#else
-# define CM_PLUGIN_EXPORT
-#endif
-
-/*=========================================================================
-define the different types of cache entries, see cmCacheManager.h for more
-information
-=========================================================================*/
-#define CM_CACHE_BOOL 0
-#define CM_CACHE_PATH 1
-#define CM_CACHE_FILEPATH 2
-#define CM_CACHE_STRING 3
-#define CM_CACHE_INTERNAL 4
-#define CM_CACHE_STATIC 5
-
-/*=========================================================================
-define the different types of compiles a library may be
-=========================================================================*/
-#define CM_LIBRARY_GENERAL 0
-#define CM_LIBRARY_DEBUG 1
-#define CM_LIBRARY_OPTIMIZED 2
-
-/*=========================================================================
-define the different types of custom commands for a target
-=========================================================================*/
-#define CM_PRE_BUILD 0
-#define CM_PRE_LINK 1
-#define CM_POST_BUILD 2
-
-/*=========================================================================
-Finally we define the key data structures and function prototypes
-=========================================================================*/
-
-/* NOLINTNEXTLINE(modernize-use-using) */
-typedef const char*(CCONV* CM_DOC_FUNCTION)();
-
-/* NOLINTNEXTLINE(modernize-use-using) */
-typedef int(CCONV* CM_INITIAL_PASS_FUNCTION)(void* info, void* mf, int argc,
- char*[]);
-
-/* NOLINTNEXTLINE(modernize-use-using) */
-typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf);
-
-/* NOLINTNEXTLINE(modernize-use-using) */
-typedef void(CCONV* CM_DESTRUCTOR_FUNCTION)(void* info);
-
-/* NOLINTNEXTLINE(modernize-use-using) */
-typedef struct
-{
- unsigned long reserved1; /* Reserved for future use. DO NOT USE. */
- unsigned long reserved2; /* Reserved for future use. DO NOT USE. */
- cmCAPI* CAPI;
- int m_Inherited; /* this ivar is no longer used in CMake 2.2 or later */
- CM_INITIAL_PASS_FUNCTION InitialPass;
- CM_FINAL_PASS_FUNCTION FinalPass;
- CM_DESTRUCTOR_FUNCTION Destructor;
- CM_DOC_FUNCTION GetTerseDocumentation;
- CM_DOC_FUNCTION GetFullDocumentation;
- const char* Name;
- char* Error;
- void* ClientData;
-} cmLoadedCommandInfo;
-
-/* NOLINTNEXTLINE(modernize-use-using) */
-typedef void(CCONV* CM_INIT_FUNCTION)(cmLoadedCommandInfo*);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index ce690bd..f4852fa 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -93,29 +93,21 @@
# include "cmAddCompileOptionsCommand.h"
# include "cmAddLinkOptionsCommand.h"
# include "cmAuxSourceDirectoryCommand.h"
-# include "cmBuildNameCommand.h"
# include "cmCMakeHostSystemInformationCommand.h"
# include "cmCMakePkgConfigCommand.h"
# include "cmExportCommand.h"
-# include "cmExportLibraryDependenciesCommand.h"
# include "cmFLTKWrapUICommand.h"
# include "cmFileAPICommand.h"
# include "cmIncludeExternalMSProjectCommand.h"
# include "cmInstallProgramsCommand.h"
# include "cmLinkLibrariesCommand.h"
# include "cmLoadCacheCommand.h"
-# include "cmLoadCommandCommand.h"
-# include "cmOutputRequiredFilesCommand.h"
# include "cmQTWrapCPPCommand.h"
# include "cmQTWrapUICommand.h"
# include "cmRemoveCommand.h"
# include "cmRemoveDefinitionsCommand.h"
# include "cmSourceGroupCommand.h"
-# include "cmSubdirDependsCommand.h"
# include "cmTargetLinkDirectoriesCommand.h"
-# include "cmUseMangledMesaCommand.h"
-# include "cmUtilitySourceCommand.h"
-# include "cmVariableRequiresCommand.h"
# include "cmVariableWatchCommand.h"
# include "cmWriteFileCommand.h"
#endif
@@ -216,12 +208,11 @@
state->AddBuiltinCommand("variable_watch", cmVariableWatchCommand);
state->AddBuiltinCommand("write_file", cmWriteFileCommand);
- state->AddDisallowedCommand(
- "build_name", cmBuildNameCommand, cmPolicies::CMP0036,
- "The build_name command should not be called; see CMP0036.");
- state->AddDisallowedCommand(
- "use_mangled_mesa", cmUseMangledMesaCommand, cmPolicies::CMP0030,
- "The use_mangled_mesa command should not be called; see CMP0030.");
+ state->AddRemovedCommand(
+ "build_name", "The build_name command has been removed; see CMP0036.");
+ state->AddRemovedCommand(
+ "use_mangled_mesa",
+ "The use_mangled_mesa command has been removed; see CMP0030.");
state->AddDisallowedCommand("exec_program", cmExecProgramCommand,
cmPolicies::CMP0153,
"The exec_program command should not be called; "
@@ -304,26 +295,23 @@
state->AddBuiltinCommand("cmake_file_api", cmFileAPICommand);
state->AddBuiltinCommand("cmake_instrumentation", cmInstrumentationCommand);
- state->AddDisallowedCommand(
- "export_library_dependencies", cmExportLibraryDependenciesCommand,
- cmPolicies::CMP0033,
- "The export_library_dependencies command should not be called; "
- "see CMP0033.");
- state->AddDisallowedCommand(
- "load_command", cmLoadCommandCommand, cmPolicies::CMP0031,
- "The load_command command should not be called; see CMP0031.");
- state->AddDisallowedCommand(
- "output_required_files", cmOutputRequiredFilesCommand, cmPolicies::CMP0032,
- "The output_required_files command should not be called; see CMP0032.");
- state->AddDisallowedCommand(
- "subdir_depends", cmSubdirDependsCommand, cmPolicies::CMP0029,
- "The subdir_depends command should not be called; see CMP0029.");
- state->AddDisallowedCommand(
- "utility_source", cmUtilitySourceCommand, cmPolicies::CMP0034,
- "The utility_source command should not be called; see CMP0034.");
- state->AddDisallowedCommand(
- "variable_requires", cmVariableRequiresCommand, cmPolicies::CMP0035,
- "The variable_requires command should not be called; see CMP0035.");
+ state->AddRemovedCommand(
+ "export_library_dependencies",
+ "The export_library_dependencies command has been removed; see CMP0033.");
+ state->AddRemovedCommand(
+ "load_command", "The load_command command has been removed; see CMP0031.");
+ state->AddRemovedCommand(
+ "output_required_files",
+ "The output_required_files command has been removed; see CMP0032.");
+ state->AddRemovedCommand(
+ "subdir_depends",
+ "The subdir_depends command has been removed; see CMP0029.");
+ state->AddRemovedCommand(
+ "utility_source",
+ "The utility_source command has been removed; see CMP0034.");
+ state->AddRemovedCommand(
+ "variable_requires",
+ "The variable_requires command has been removed; see CMP0035.");
#endif
}
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 39bd180..106dd84 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -671,11 +671,6 @@
cmComputeLinkDepends::~cmComputeLinkDepends() = default;
-void cmComputeLinkDepends::SetOldLinkDirMode(bool b)
-{
- this->OldLinkDirMode = b;
-}
-
std::vector<cmComputeLinkDepends::LinkEntry> const&
cmComputeLinkDepends::Compute()
{
@@ -884,11 +879,6 @@
// 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 @@
// 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 @@
this->AddLinkEntries(cm::nullopt, runtimeEntries->second);
}
}
- for (cmLinkItem const& wi : impl->WrongConfigLibraries) {
- this->CheckWrongConfigItem(wi);
- }
}
template <typename T>
@@ -1736,17 +1720,3 @@
}
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);
- }
-}
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index dc2fa45..10552b8 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -85,12 +85,6 @@
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 @@
// 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;
};
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index da51644..db589e1 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -422,25 +422,6 @@
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 @@
// 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 @@
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 @@
}
} 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 @@
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 @@
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 @@
}
}
- // 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 @@
// 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 @@
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 @@
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 @@
// 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 @@
// 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.
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 97db90d..98f6e7e 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -4,7 +4,6 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <iosfwd>
#include <map>
#include <memory>
#include <set>
@@ -210,13 +209,12 @@
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 @@
// Linker search path computation.
std::unique_ptr<cmOrderDirectories> OrderLinkerSearchPath;
- bool FinishLinkerSearchDirectories();
- void PrintLinkPolicyDiagnosis(std::ostream&);
void AddExternalObjectTargets();
@@ -243,17 +239,12 @@
// 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;
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index bb5508c..3cc1500 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -17,12 +17,12 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
-#include "cmPolicies.h"
#include "cmRange.h"
#include "cmSourceFile.h"
#include "cmSourceFileLocationKind.h"
#include "cmState.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetDepend.h"
@@ -353,29 +353,11 @@
if (!dependee && !linking &&
(depender->GetType() != cmStateEnums::GLOBAL_TARGET)) {
- MessageType messageType = MessageType::AUTHOR_WARNING;
- bool issueMessage = false;
- std::ostringstream e;
- switch (depender->GetPolicyStatusCMP0046()) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0046) << "\n";
- issueMessage = true;
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- issueMessage = true;
- messageType = MessageType::FATAL_ERROR;
- break;
- }
- if (issueMessage) {
- cmake* cm = this->GlobalGenerator->GetCMakeInstance();
-
- e << "The dependency target \"" << dependee_name << "\" of target \""
- << depender->GetName() << "\" does not exist.";
-
- cm->IssueMessage(messageType, e.str(), dependee_name.Backtrace);
- }
+ this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("The dependency target \"", dependee_name.AsStr(),
+ "\" of target \"", depender->GetName(), "\" does not exist."),
+ dependee_name.Backtrace);
}
// Skip targets that will not really be linked. This is probably a
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index e5b079b..5603fb0 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -219,7 +219,6 @@
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 @@
return false;
}
- return this->GetBooleanValueWithAutoDereference(newArgs.front(), errorString,
- status, true);
+ return this->GetBooleanValue(newArgs.front());
}
//=========================================================================
@@ -402,64 +400,6 @@
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 @@
//=========================================================================
// 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 @@
//=========================================================================
// 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 @@
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<
diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h
index 4f42206..796f38c 100644
--- a/Source/cmConditionEvaluator.h
+++ b/Source/cmConditionEvaluator.h
@@ -42,14 +42,6 @@
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 @@
cmMakefile& Makefile;
cmListFileBacktrace Backtrace;
- cmPolicies::PolicyStatus Policy12Status;
cmPolicies::PolicyStatus Policy54Status;
cmPolicies::PolicyStatus Policy57Status;
cmPolicies::PolicyStatus Policy64Status;
diff --git a/Source/cmExportAndroidMKGenerator.cxx b/Source/cmExportAndroidMKGenerator.cxx
index 34dc1a7..4db5e3b 100644
--- a/Source/cmExportAndroidMKGenerator.cxx
+++ b/Source/cmExportAndroidMKGenerator.cxx
@@ -12,13 +12,9 @@
#include "cmGeneratorTarget.h"
#include "cmLinkItem.h"
#include "cmList.h"
-#include "cmMakefile.h"
-#include "cmMessageType.h"
-#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-#include "cmTarget.h"
cmExportAndroidMKGenerator::cmExportAndroidMKGenerator() = default;
@@ -52,20 +48,6 @@
(this->Configurations.empty() ? std::string{} : this->Configurations[0]);
GenerateType const type = this->GetGenerateType();
- bool const newCMP0022Behavior =
- target->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
- if (!newCMP0022Behavior) {
- std::ostringstream w;
- if (type == BUILD) {
- w << "export(TARGETS ... ANDROID_MK) called with policy CMP0022";
- } else {
- w << "install( EXPORT_ANDROID_MK ...) called with policy CMP0022";
- }
- w << " set to OLD for target " << target->Target->GetName() << ". "
- << "The export will only work with CMP0022 set to NEW.";
- target->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
- }
if (!properties.empty()) {
os << "LOCAL_CPP_FEATURES := rtti exceptions\n";
for (auto const& property : properties) {
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index a5f6ca3..ad9ec04 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -7,7 +7,6 @@
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
-#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -34,13 +33,8 @@
return false;
}
- bool const newCMP0022Behavior =
- gte->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- gte->GetPolicyStatusCMP0022() != cmPolicies::OLD;
- if (newCMP0022Behavior) {
- this->PopulateInterfaceLinkLibrariesProperty(
- gte, cmGeneratorExpression::BuildInterface, properties);
- }
+ this->PopulateInterfaceLinkLibrariesProperty(
+ gte, cmGeneratorExpression::BuildInterface, properties);
this->GenerateInterfaceProperties(gte, os, properties);
}
diff --git a/Source/cmExportBuildCMakeConfigGenerator.cxx b/Source/cmExportBuildCMakeConfigGenerator.cxx
index 87aeb3c..b8ed712 100644
--- a/Source/cmExportBuildCMakeConfigGenerator.cxx
+++ b/Source/cmExportBuildCMakeConfigGenerator.cxx
@@ -24,7 +24,6 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOutputConverter.h"
-#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -72,13 +71,8 @@
return false;
}
- bool const newCMP0022Behavior =
- gte->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- gte->GetPolicyStatusCMP0022() != cmPolicies::OLD;
- if (newCMP0022Behavior) {
- this->PopulateInterfaceLinkLibrariesProperty(
- gte, cmGeneratorExpression::BuildInterface, properties);
- }
+ this->PopulateInterfaceLinkLibrariesProperty(
+ gte, cmGeneratorExpression::BuildInterface, properties);
this->GenerateInterfaceProperties(gte, os, properties);
diff --git a/Source/cmExportCMakeConfigGenerator.cxx b/Source/cmExportCMakeConfigGenerator.cxx
index 79844d5..bb9de54 100644
--- a/Source/cmExportCMakeConfigGenerator.cxx
+++ b/Source/cmExportCMakeConfigGenerator.cxx
@@ -17,12 +17,10 @@
#include "cmFindPackageStack.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
-#include "cmLinkItem.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOutputConverter.h"
-#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -30,6 +28,8 @@
#include "cmValue.h"
#include "cmVersion.h"
+struct cmLinkInterface;
+
static std::string cmExportFileGeneratorEscape(std::string const& str)
{
// Escape a property value for writing into a .cmake file.
@@ -111,14 +111,6 @@
return;
}
- if (iface->ImplementationIsInterface) {
- // Policy CMP0022 must not be NEW.
- this->SetImportLinkProperty(
- suffix, target, "IMPORTED_LINK_INTERFACE_LIBRARIES", iface->Libraries,
- properties, ImportLinkPropertyTargetNames::Yes);
- return;
- }
-
cmValue propContent;
if (cmValue prop_suffixed =
@@ -130,11 +122,7 @@
return;
}
- bool const newCMP0022Behavior =
- target->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
-
- if (newCMP0022Behavior && !this->ExportOld) {
+ if (!this->ExportOld) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::ostringstream e;
e << "Target \"" << target->GetName()
diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx
index c9c2f4e..3b52966 100644
--- a/Source/cmExportInstallAndroidMKGenerator.cxx
+++ b/Source/cmExportInstallAndroidMKGenerator.cxx
@@ -12,7 +12,6 @@
#include "cmGeneratorTarget.h"
#include "cmInstallExportGenerator.h"
#include "cmInstallTargetGenerator.h"
-#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -58,13 +57,8 @@
return false;
}
- bool const newCMP0022Behavior =
- gt->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- gt->GetPolicyStatusCMP0022() != cmPolicies::OLD;
- if (newCMP0022Behavior) {
- this->PopulateInterfaceLinkLibrariesProperty(
- gt, cmGeneratorExpression::InstallInterface, properties);
- }
+ this->PopulateInterfaceLinkLibrariesProperty(
+ gt, cmGeneratorExpression::InstallInterface, properties);
this->GenerateInterfaceProperties(gt, os, properties);
}
diff --git a/Source/cmExportInstallCMakeConfigGenerator.cxx b/Source/cmExportInstallCMakeConfigGenerator.cxx
index e1b2285..4b37bca 100644
--- a/Source/cmExportInstallCMakeConfigGenerator.cxx
+++ b/Source/cmExportInstallCMakeConfigGenerator.cxx
@@ -25,7 +25,6 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOutputConverter.h"
-#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -83,15 +82,10 @@
return false;
}
- bool const newCMP0022Behavior =
- gt->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- gt->GetPolicyStatusCMP0022() != cmPolicies::OLD;
- if (newCMP0022Behavior) {
- if (this->PopulateInterfaceLinkLibrariesProperty(
- gt, cmGeneratorExpression::InstallInterface, properties) &&
- !this->ExportOld) {
- this->SetRequiredCMakeVersion(2, 8, 12);
- }
+ if (this->PopulateInterfaceLinkLibrariesProperty(
+ gt, cmGeneratorExpression::InstallInterface, properties) &&
+ !this->ExportOld) {
+ this->SetRequiredCMakeVersion(2, 8, 12);
}
if (targetType == cmStateEnums::INTERFACE_LIBRARY) {
this->SetRequiredCMakeVersion(3, 0, 0);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index b89c553..e00636c 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -439,24 +439,9 @@
if (cmHasPrefix(li, this->GetImportPrefixWithSlash())) {
continue;
}
- MessageType messageType = MessageType::FATAL_ERROR;
std::ostringstream e;
if (genexPos != std::string::npos) {
- if (prop == "INTERFACE_INCLUDE_DIRECTORIES") {
- switch (target->GetPolicyStatusCMP0041()) {
- case cmPolicies::WARN:
- messageType = MessageType::WARNING;
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0041) << "\n";
- break;
- case cmPolicies::OLD:
- continue;
- case cmPolicies::NEW:
- hadFatalError = true;
- break; // Issue fatal message.
- }
- } else {
- hadFatalError = true;
- }
+ hadFatalError = true;
}
if (!cmSystemTools::FileIsFullPath(li)) {
/* clang-format off */
@@ -464,7 +449,8 @@
" property contains relative path:\n"
" \"" << li << "\"";
/* clang-format on */
- target->GetLocalGenerator()->IssueMessage(messageType, e.str());
+ target->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str());
}
bool inBinary = isSubDirectory(li, topBinaryDir);
bool inSource = isSubDirectory(li, topSourceDir);
@@ -516,7 +502,8 @@
" property contains path:\n"
" \"" << li << "\"\nwhich is prefixed in the build directory.";
/* clang-format on */
- target->GetLocalGenerator()->IssueMessage(messageType, e.str());
+ target->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str());
}
if (!inSourceBuild) {
if (inSource) {
@@ -524,7 +511,8 @@
<< " property contains path:\n"
" \""
<< li << "\"\nwhich is prefixed in the source directory.";
- target->GetLocalGenerator()->IssueMessage(messageType, e.str());
+ target->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str());
}
}
}
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
deleted file mode 100644
index 02d0444..0000000
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmExportLibraryDependenciesCommand.h"
-
-#include <map>
-#include <unordered_map>
-#include <utility>
-
-#include <cm/memory>
-
-#include "cmsys/FStream.hxx"
-
-#include "cmExecutionStatus.h"
-#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
-#include "cmLocalGenerator.h"
-#include "cmMakefile.h"
-#include "cmStateTypes.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-#include "cmTarget.h"
-#include "cmTargetLinkLibraryType.h"
-#include "cmValue.h"
-#include "cmake.h"
-
-class cmListFileBacktrace;
-
-static void FinalAction(cmMakefile& makefile, std::string const& filename,
- bool append)
-{
- // Use copy-if-different if not appending.
- std::unique_ptr<cmsys::ofstream> foutPtr;
- if (append) {
- const auto openmodeApp = std::ios::app;
- foutPtr = cm::make_unique<cmsys::ofstream>(filename.c_str(), openmodeApp);
- } else {
- std::unique_ptr<cmGeneratedFileStream> ap(
- new cmGeneratedFileStream(filename, true));
- ap->SetCopyIfDifferent(true);
- foutPtr = std::move(ap);
- }
- std::ostream& fout = *foutPtr;
-
- if (!fout) {
- cmSystemTools::Error("Error Writing " + filename);
- cmSystemTools::ReportLastSystemError("");
- return;
- }
-
- // Collect dependency information about all library targets built in
- // the project.
- cmake* cm = makefile.GetCMakeInstance();
- cmGlobalGenerator* global = cm->GetGlobalGenerator();
- const auto& locals = global->GetMakefiles();
- std::map<std::string, std::string> libDepsOld;
- std::map<std::string, std::string> libDepsNew;
- std::map<std::string, std::string> libTypes;
- for (const auto& local : locals) {
- for (auto const& tgt : local->GetTargets()) {
- // Get the current target.
- cmTarget const& target = tgt.second;
-
- // Skip non-library targets.
- if (target.GetType() < cmStateEnums::STATIC_LIBRARY ||
- target.GetType() > cmStateEnums::MODULE_LIBRARY) {
- continue;
- }
-
- // Construct the dependency variable name.
- std::string targetEntry = cmStrCat(target.GetName(), "_LIB_DEPENDS");
-
- // Construct the dependency variable value with the direct link
- // dependencies.
- std::string valueOld;
- std::string valueNew;
- cmTarget::LinkLibraryVectorType const& libs =
- target.GetOriginalLinkLibraries();
- for (cmTarget::LibraryID const& li : libs) {
- std::string ltVar = cmStrCat(li.first, "_LINK_TYPE");
- std::string ltValue;
- switch (li.second) {
- case GENERAL_LibraryType:
- valueNew += "general;";
- ltValue = "general";
- break;
- case DEBUG_LibraryType:
- valueNew += "debug;";
- ltValue = "debug";
- break;
- case OPTIMIZED_LibraryType:
- valueNew += "optimized;";
- ltValue = "optimized";
- break;
- }
- std::string lib = li.first;
- if (cmTarget* libtgt = global->FindTarget(lib)) {
- // Handle simple output name changes. This command is
- // deprecated so we do not support full target name
- // translation (which requires per-configuration info).
- if (cmValue outname = libtgt->GetProperty("OUTPUT_NAME")) {
- lib = *outname;
- }
- }
- valueOld += lib;
- valueOld += ";";
- valueNew += lib;
- valueNew += ";";
-
- std::string& ltEntry = libTypes[ltVar];
- if (ltEntry.empty()) {
- ltEntry = ltValue;
- } else if (ltEntry != ltValue) {
- ltEntry = "general";
- }
- }
- libDepsNew[targetEntry] = valueNew;
- libDepsOld[targetEntry] = valueOld;
- }
- }
-
- // Generate dependency information for both old and new style CMake
- // versions.
- const char* vertest =
- "\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" GREATER 2.4";
- fout << "# Generated by CMake\n\n";
- fout << "if(" << vertest << ")\n";
- fout << " # Information for CMake 2.6 and above.\n";
- for (auto const& i : libDepsNew) {
- if (!i.second.empty()) {
- fout << " set(\"" << i.first << "\" \"" << i.second << "\")\n";
- }
- }
- fout << "else()\n";
- fout << " # Information for CMake 2.4 and lower.\n";
- for (auto const& i : libDepsOld) {
- if (!i.second.empty()) {
- fout << " set(\"" << i.first << "\" \"" << i.second << "\")\n";
- }
- }
- for (auto const& i : libTypes) {
- if (i.second != "general") {
- fout << " set(\"" << i.first << "\" \"" << i.second << "\")\n";
- }
- }
- fout << "endif()\n";
-}
-
-bool cmExportLibraryDependenciesCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status)
-{
- if (args.empty()) {
- status.SetError("called with incorrect number of arguments");
- return false;
- }
-
- std::string const& filename = args[0];
- bool const append = args.size() > 1 && args[1] == "APPEND";
- status.GetMakefile().AddGeneratorAction(
- [filename, append](cmLocalGenerator& lg, const cmListFileBacktrace&) {
- FinalAction(*lg.GetMakefile(), filename, append);
- });
-
- return true;
-}
diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h
deleted file mode 100644
index 1834bfa..0000000
--- a/Source/cmExportLibraryDependenciesCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmExportLibraryDependenciesCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index be25647..496f12a 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -703,12 +703,6 @@
{
Target t(gt, this->Config);
std::string prefix = "target-" + gt->GetName();
- for (char& c : prefix) {
- // CMP0037 OLD behavior allows slashes in target names. Remove them.
- if (c == '/' || c == '\\') {
- c = '_';
- }
- }
if (!this->Config.empty()) {
prefix += "-" + this->Config;
}
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 99dc7ef..9eec090 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -677,28 +677,14 @@
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 @@
} 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 @@
}
}
- if (recurse && !explicitFollowSymlinks &&
- g.GetFollowedSymlinkCount() != 0) {
- warnFollowedSymlinks = true;
- }
-
std::vector<std::string>& foundFiles = g.GetFiles();
cm::append(files, foundFiles);
@@ -834,24 +814,6 @@
}
}
- 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));
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 69cc2d6..1e36526 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -2789,8 +2789,8 @@
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.
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index ccb5222..a1c4ea5 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1927,7 +1927,6 @@
static cmsys::RegularExpression compilerIdValidator("^[A-Za-z0-9_]*$");
for (auto const& param : parameters) {
-
if (!compilerIdValidator.find(param)) {
reportError(context, content->GetOriginalExpression(),
"Expression syntax not recognized.");
@@ -1937,22 +1936,6 @@
if (strcmp(param.c_str(), compilerId.c_str()) == 0) {
return "1";
}
-
- if (cmsysString_strcasecmp(param.c_str(), compilerId.c_str()) == 0) {
- switch (context->LG->GetPolicyStatus(cmPolicies::CMP0044)) {
- case cmPolicies::WARN: {
- context->LG->GetCMakeInstance()->IssueMessage(
- MessageType::AUTHOR_WARNING,
- cmPolicies::GetPolicyWarning(cmPolicies::CMP0044),
- context->Backtrace);
- CM_FALLTHROUGH;
- }
- case cmPolicies::OLD:
- return "1";
- case cmPolicies::NEW:
- break;
- }
- }
}
return "0";
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e2a0f21..b6d14e8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -67,15 +67,7 @@
template <>
const std::string&
-cmTargetPropertyComputer::ComputeLocationForBuild<cmGeneratorTarget>(
- cmGeneratorTarget const* tgt)
-{
- return tgt->GetLocation("");
-}
-
-template <>
-const std::string&
-cmTargetPropertyComputer::ComputeLocation<cmGeneratorTarget>(
+cmTargetPropertyComputer::ImportedLocation<cmGeneratorTarget>(
cmGeneratorTarget const* tgt, const std::string& config)
{
return tgt->GetLocation(config);
@@ -1548,14 +1540,7 @@
return this->GetPropertyAsBool("MACOSX_RPATH");
}
- cmPolicies::PolicyStatus cmp0042 = this->GetPolicyStatusCMP0042();
-
- if (cmp0042 == cmPolicies::WARN) {
- this->LocalGenerator->GetGlobalGenerator()->AddCMP0042WarnTarget(
- this->GetName());
- }
-
- return cmp0042 == cmPolicies::NEW;
+ return true;
}
bool cmGeneratorTarget::MacOSXUseInstallNameDir() const
@@ -2041,6 +2026,14 @@
return std::move(archList.data());
}
+const std::string& cmGeneratorTarget::GetTargetLabelsString()
+{
+ this->targetLabelsString = this->GetSafeProperty("LABELS");
+ std::replace(this->targetLabelsString.begin(),
+ this->targetLabelsString.end(), ';', ',');
+ return this->targetLabelsString;
+}
+
namespace {
bool IsSupportedClassifiedFlagsLanguage(std::string const& lang)
@@ -2305,6 +2298,7 @@
cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = this->GetName().c_str();
vars.CMTargetType = cmState::GetTargetTypeName(this->GetType()).c_str();
+ vars.CMTargetLabels = this->GetTargetLabelsString().c_str();
vars.Language = lang.c_str();
auto const sfPath = this->LocalGenerator->ConvertToOutputFormat(
@@ -4193,9 +4187,7 @@
bool debugOrigin = !this->DebugCompatiblePropertiesDone[p] &&
cm::contains(debugProperties, p);
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugCompatiblePropertiesDone[p] = true;
- }
+ this->DebugCompatiblePropertiesDone[p] = true;
if (!debugOrigin) {
return;
}
@@ -4700,14 +4692,15 @@
return true;
}
-void cmGeneratorTarget::GetObjectLibrariesCMP0026(
+void cmGeneratorTarget::GetObjectLibrariesInSources(
std::vector<cmGeneratorTarget*>& objlibs) const
{
- // At configure-time, this method can be called as part of getting the
- // LOCATION property or to export() a file to be include()d. However
- // there is no cmGeneratorTarget at configure-time, so search the SOURCES
- // for TARGET_OBJECTS instead for backwards compatibility with OLD
- // behavior of CMP0024 and CMP0026 only.
+ // FIXME: This searches SOURCES for TARGET_OBJECTS for backwards
+ // compatibility with the OLD behavior of CMP0026 since this
+ // could be called at configure time. CMP0026 has been removed,
+ // so this should now be called only at generate time.
+ // Therefore we should be able to improve the implementation
+ // with generate-time information.
cmBTStringRange rng = this->Target->GetSourceEntries();
for (auto const& entry : rng) {
cmList files{ entry.Value };
@@ -4744,27 +4737,11 @@
}
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;
}
@@ -4801,16 +4778,8 @@
}
}
- std::set<cmGeneratorTarget const*> objectLibraries;
- if (!this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- std::vector<cmGeneratorTarget*> objectTargets;
- this->GetObjectLibrariesCMP0026(objectTargets);
- for (cmGeneratorTarget* gt : objectTargets) {
- objectLibraries.insert(gt);
- }
- } else {
- objectLibraries = this->GetSourceObjectLibraries(config);
- }
+ std::set<cmGeneratorTarget const*> objectLibraries =
+ this->GetSourceObjectLibraries(config);
for (cmGeneratorTarget const* objLib : objectLibraries) {
objLib->GetLanguages(languages, config);
}
@@ -5019,7 +4988,7 @@
std::vector<std::string> allConfigs =
this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
cmOptionalLinkImplementation impl;
- this->ComputeLinkImplementationLibraries(config, impl, this, UseTo::Link);
+ this->ComputeLinkImplementationLibraries(config, impl, UseTo::Link);
cmCxxModuleUsageEffects usage(this);
@@ -5481,11 +5450,8 @@
verifyTarget->SetProperty("DISABLE_PRECOMPILE_HEADERS", "ON");
verifyTarget->SetProperty("UNITY_BUILD", "OFF");
verifyTarget->SetProperty("CXX_SCAN_FOR_MODULES", "OFF");
- cm::optional<std::map<std::string, cmValue>>
- perConfigCompileDefinitions;
verifyTarget->FinalizeTargetConfiguration(
- this->Makefile->GetCompileDefinitionsEntries(),
- perConfigCompileDefinitions);
+ this->Makefile->GetCompileDefinitionsEntries());
if (!allVerifyTarget) {
allVerifyTarget = this->GlobalGenerator->GetMakefiles()
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f2ff038..23107a2 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -402,6 +402,8 @@
cmLocalGenerator* LocalGenerator;
cmGlobalGenerator const* GlobalGenerator;
+ std::string targetLabelsString;
+
struct ModuleDefinitionInfo
{
std::string DefFile;
@@ -447,7 +449,6 @@
void ComputeLinkImplementationLibraries(const std::string& config,
cmOptionalLinkImplementation& impl,
- const cmGeneratorTarget* head,
UseTo usage) const;
struct TargetOrString
@@ -488,7 +489,7 @@
bool IsDotNetSdkTarget() const;
- void GetObjectLibrariesCMP0026(
+ void GetObjectLibrariesInSources(
std::vector<cmGeneratorTarget*>& objlibs) const;
std::string GetFullNameImported(const std::string& config,
@@ -514,6 +515,8 @@
std::vector<std::string> GetAppleArchs(std::string const& config,
cm::optional<std::string> lang) const;
+ const std::string& GetTargetLabelsString();
+
// The classification of the flag.
enum class FlagClassification
{
@@ -1234,7 +1237,6 @@
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,
@@ -1357,22 +1359,10 @@
void GetSourceFilesWithoutObjectLibraries(std::vector<cmSourceFile*>& files,
const std::string& config) const;
- struct HeadToLinkImplementationMap
- : public std::map<cmGeneratorTarget const*, cmOptionalLinkImplementation>
- {
- };
- using LinkImplMapType = std::map<std::string, HeadToLinkImplementationMap>;
+ using LinkImplMapType = std::map<std::string, cmOptionalLinkImplementation>;
mutable LinkImplMapType LinkImplMap;
mutable LinkImplMapType LinkImplUsageRequirementsOnlyMap;
- HeadToLinkImplementationMap& GetHeadToLinkImplementationMap(
- std::string const& config) const;
- HeadToLinkImplementationMap& GetHeadToLinkImplementationUsageRequirementsMap(
- std::string const& config) const;
-
- cmLinkImplementationLibraries const* GetLinkImplementationLibrariesInternal(
- const std::string& config, const cmGeneratorTarget* head,
- UseTo usage) const;
bool ComputeOutputDir(const std::string& config,
cmStateEnums::ArtifactType artifact,
std::string& out) const;
@@ -1391,7 +1381,6 @@
mutable OutputNameMapType OutputNameMap;
mutable std::set<cmLinkItem> UtilityItems;
cmPolicies::PolicyMap PolicyMap;
- mutable bool PolicyWarnedCMP0022 = false;
mutable bool PolicyReportedCMP0069 = false;
mutable bool DebugIncludesDone = false;
mutable bool DebugCompileOptionsDone = false;
diff --git a/Source/cmGeneratorTarget_IncludeDirectories.cxx b/Source/cmGeneratorTarget_IncludeDirectories.cxx
index fc89331..52ec146 100644
--- a/Source/cmGeneratorTarget_IncludeDirectories.cxx
+++ b/Source/cmGeneratorTarget_IncludeDirectories.cxx
@@ -25,7 +25,6 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
-#include "cmPolicies.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
@@ -149,43 +148,27 @@
cmLinkImplItem const& item = entry.LinkImplItem;
std::string const& targetName = item.AsStr();
bool const fromImported = item.Target && item.Target->IsImported();
- bool const checkCMP0027 = item.CheckCMP0027;
std::string usedIncludes;
for (std::string& entryInclude : entry.Values) {
if (fromImported && !cmSystemTools::FileExists(entryInclude)) {
- std::ostringstream e;
- MessageType messageType = MessageType::FATAL_ERROR;
- if (checkCMP0027) {
- switch (tgt->GetPolicyStatusCMP0027()) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0027) << "\n";
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- messageType = MessageType::AUTHOR_WARNING;
- break;
- case cmPolicies::NEW:
- break;
- }
- }
- /* clang-format off */
- e << "Imported target \"" << targetName << "\" includes "
- "non-existent path\n \"" << entryInclude << "\"\nin its "
- "INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:\n"
- "* The path was deleted, renamed, or moved to another "
- "location.\n"
- "* An install or uninstall procedure did not complete "
- "successfully.\n"
- "* The installation package was faulty and references files it "
- "does not provide.\n";
- /* clang-format on */
- tgt->GetLocalGenerator()->IssueMessage(messageType, e.str());
+ tgt->GetLocalGenerator()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "Imported target \"", targetName,
+ "\" includes non-existent path\n \"", entryInclude,
+ "\"\nin its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons "
+ "include:\n"
+ "* The path was deleted, renamed, or moved to another location.\n"
+ "* An install or uninstall procedure did not complete "
+ "successfully.\n"
+ "* The installation package was faulty and references files it "
+ "does not provide.\n"));
return;
}
if (!cmSystemTools::FileIsFullPath(entryInclude)) {
std::ostringstream e;
- bool noMessage = false;
MessageType messageType = MessageType::FATAL_ERROR;
if (!targetName.empty()) {
/* clang-format off */
@@ -194,27 +177,13 @@
" \"" << entryInclude << "\"";
/* clang-format on */
} else {
- switch (tgt->GetPolicyStatusCMP0021()) {
- case cmPolicies::WARN: {
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0021) << "\n";
- messageType = MessageType::AUTHOR_WARNING;
- } break;
- case cmPolicies::OLD:
- noMessage = true;
- break;
- case cmPolicies::NEW:
- // Issue the fatal message.
- break;
- }
e << "Found relative path while evaluating include directories of "
"\""
<< tgt->GetName() << "\":\n \"" << entryInclude << "\"\n";
}
- if (!noMessage) {
- tgt->GetLocalGenerator()->IssueMessage(messageType, e.str());
- if (messageType == MessageType::FATAL_ERROR) {
- return;
- }
+ tgt->GetLocalGenerator()->IssueMessage(messageType, e.str());
+ if (messageType == MessageType::FATAL_ERROR) {
+ return;
}
}
@@ -262,9 +231,7 @@
bool debugIncludes = !this->DebugIncludesDone &&
cm::contains(debugProperties, "INCLUDE_DIRECTORIES");
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugIncludesDone = true;
- }
+ this->DebugIncludesDone = true;
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, lang, &dagChecker, this->IncludeDirectoriesEntries);
diff --git a/Source/cmGeneratorTarget_Link.cxx b/Source/cmGeneratorTarget_Link.cxx
index 92e5ddf..f000c32 100644
--- a/Source/cmGeneratorTarget_Link.cxx
+++ b/Source/cmGeneratorTarget_Link.cxx
@@ -382,16 +382,8 @@
}
// Check link the implementation for each generated configuration.
- for (auto const& hmp : this->LinkImplMap) {
- HeadToLinkImplementationMap const& hm = hmp.second;
- // There could be several entries used when computing the pre-CMP0022
- // default link interface. Check only the entry for our own link impl.
- auto const hmi = hm.find(this);
- if (hmi == hm.end() || !hmi->second.LibrariesDone ||
- !hmi->second.CheckLinkLibraries) {
- continue;
- }
- for (cmLinkImplItem const& item : hmi->second.Libraries) {
+ for (auto const& impl : this->LinkImplMap) {
+ for (cmLinkImplItem const& item : impl.second.Libraries) {
if (!this->VerifyLinkItemColons(LinkItemRole::Implementation, item)) {
return;
}
@@ -451,20 +443,7 @@
item.AsStr().find("::") == std::string::npos) {
return true;
}
- MessageType messageType = MessageType::FATAL_ERROR;
std::string e;
- switch (this->GetLocalGenerator()->GetPolicyStatus(cmPolicies::CMP0028)) {
- case cmPolicies::WARN: {
- e = cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0028), "\n");
- messageType = MessageType::AUTHOR_WARNING;
- } break;
- case cmPolicies::OLD:
- return true;
- case cmPolicies::NEW:
- // Issue the fatal message.
- break;
- }
-
if (role == LinkItemRole::Implementation) {
e = cmStrCat(e, "Target \"", this->GetName(), "\" links to");
} else {
@@ -478,8 +457,8 @@
if (backtrace.Empty()) {
backtrace = this->GetBacktrace();
}
- this->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(messageType, e,
- backtrace);
+ this->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR, e, backtrace);
return false;
}
@@ -676,7 +655,7 @@
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,48 +663,38 @@
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 ||
- this->GetType() == cmStateEnums::STATIC_LIBRARY ||
- this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
- // Shared libraries may have runtime implementation dependencies
- // on other shared libraries that are not in the interface.
- std::set<cmLinkItem> emitted;
- for (cmLinkItem const& lib : iface.Libraries) {
- emitted.insert(lib);
- }
- if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
- cmLinkImplementation const* impl =
- this->GetLinkImplementation(config, UseTo::Link, secondPass);
- for (cmLinkImplItem const& lib : impl->Libraries) {
- if (emitted.insert(lib).second) {
- if (lib.Target) {
- // This is a runtime dependency on another shared library.
- if (lib.Target->GetType() == cmStateEnums::SHARED_LIBRARY) {
- iface.SharedDeps.push_back(lib);
- }
- } else {
- // TODO: Recognize shared library file names. Perhaps this
- // should be moved to cmComputeLinkInformation, but that
- // creates a chicken-and-egg problem since this list is needed
- // for its construction.
+ if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ this->GetType() == cmStateEnums::STATIC_LIBRARY ||
+ this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ // Shared libraries may have runtime implementation dependencies
+ // on other shared libraries that are not in the interface.
+ std::set<cmLinkItem> emitted;
+ for (cmLinkItem const& lib : iface.Libraries) {
+ emitted.insert(lib);
+ }
+ if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
+ cmLinkImplementation const* impl =
+ this->GetLinkImplementation(config, UseTo::Link, secondPass);
+ for (cmLinkImplItem const& lib : impl->Libraries) {
+ if (emitted.insert(lib).second) {
+ if (lib.Target) {
+ // This is a runtime dependency on another shared library.
+ if (lib.Target->GetType() == cmStateEnums::SHARED_LIBRARY) {
+ iface.SharedDeps.push_back(lib);
}
+ } else {
+ // TODO: Recognize shared library file names. Perhaps this
+ // should be moved to cmComputeLinkInformation, but that
+ // creates a chicken-and-egg problem since this list is needed
+ // for its construction.
}
}
}
}
- } 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()) {
@@ -808,62 +777,10 @@
// An explicit list of interface libraries may be set for shared
// libraries and executables that export symbols.
- bool haveExplicitLibraries = false;
- cmValue explicitLibrariesCMP0022OLD;
- std::string linkIfacePropCMP0022OLD;
- bool const cmp0022NEW = (this->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
- this->GetPolicyStatusCMP0022() != cmPolicies::WARN);
- if (cmp0022NEW) {
- // CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES.
- haveExplicitLibraries = !this->Target->GetLinkInterfaceEntries().empty() ||
- !this->Target->GetLinkInterfaceDirectEntries().empty() ||
- !this->Target->GetLinkInterfaceDirectExcludeEntries().empty();
- } else {
- // CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a
- // shared lib or executable.
- if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
- this->IsExecutableWithExports()) {
- // Lookup the per-configuration property.
- linkIfacePropCMP0022OLD = cmStrCat("LINK_INTERFACE_LIBRARIES", suffix);
- explicitLibrariesCMP0022OLD = this->GetProperty(linkIfacePropCMP0022OLD);
-
- // If not set, try the generic property.
- if (!explicitLibrariesCMP0022OLD) {
- linkIfacePropCMP0022OLD = "LINK_INTERFACE_LIBRARIES";
- explicitLibrariesCMP0022OLD =
- this->GetProperty(linkIfacePropCMP0022OLD);
- }
- }
-
- if (explicitLibrariesCMP0022OLD &&
- this->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
- !this->PolicyWarnedCMP0022) {
- // Compare the explicitly set old link interface properties to the
- // preferred new link interface property one and warn if different.
- cmValue newExplicitLibraries =
- this->GetProperty("INTERFACE_LINK_LIBRARIES");
- if (newExplicitLibraries &&
- (*newExplicitLibraries != *explicitLibrariesCMP0022OLD)) {
- std::ostringstream w;
- /* clang-format off */
- w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0022) << "\n"
- "Target \"" << this->GetName() << "\" has an "
- "INTERFACE_LINK_LIBRARIES property which differs from its " <<
- linkIfacePropCMP0022OLD << " properties."
- "\n"
- "INTERFACE_LINK_LIBRARIES:\n"
- " " << *newExplicitLibraries << "\n" <<
- linkIfacePropCMP0022OLD << ":\n"
- " " << *explicitLibrariesCMP0022OLD << "\n";
- /* clang-format on */
- this->LocalGenerator->IssueMessage(MessageType::AUTHOR_WARNING,
- w.str());
- this->PolicyWarnedCMP0022 = true;
- }
- }
-
- haveExplicitLibraries = static_cast<bool>(explicitLibrariesCMP0022OLD);
- }
+ bool const haveExplicitLibraries =
+ !this->Target->GetLinkInterfaceEntries().empty() ||
+ !this->Target->GetLinkInterfaceDirectEntries().empty() ||
+ !this->Target->GetLinkInterfaceDirectExcludeEntries().empty();
// There is no implicit link interface for executables or modules
// so if none was explicitly set then there is no link interface.
@@ -874,84 +791,19 @@
}
iface.Exists = true;
- // If CMP0022 is NEW then the plain tll signature sets the
- // INTERFACE_LINK_LIBRARIES property. Even if the project
- // clears it, the link interface is still explicit.
- iface.Explicit = cmp0022NEW || explicitLibrariesCMP0022OLD;
-
- if (cmp0022NEW) {
- // The interface libraries are specified by INTERFACE_LINK_LIBRARIES.
- // Use its special representation directly to get backtraces.
- this->ExpandLinkItems(
- kINTERFACE_LINK_LIBRARIES, this->Target->GetLinkInterfaceEntries(),
- config, headTarget, usage, LinkInterfaceField::Libraries, iface);
- this->ExpandLinkItems(kINTERFACE_LINK_LIBRARIES_DIRECT,
- this->Target->GetLinkInterfaceDirectEntries(),
- config, headTarget, usage,
- LinkInterfaceField::HeadInclude, iface);
- this->ExpandLinkItems(kINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE,
- this->Target->GetLinkInterfaceDirectExcludeEntries(),
- config, headTarget, usage,
- LinkInterfaceField::HeadExclude, iface);
- } else if (explicitLibrariesCMP0022OLD) {
- // The interface libraries have been explicitly set in pre-CMP0022 style.
- std::vector<BT<std::string>> entries;
- entries.emplace_back(*explicitLibrariesCMP0022OLD);
- this->ExpandLinkItems(linkIfacePropCMP0022OLD, cmMakeRange(entries),
- config, headTarget, usage,
- LinkInterfaceField::Libraries, iface);
- }
-
- // If the link interface is explicit, do not fall back to the link impl.
- if (iface.Explicit) {
- return;
- }
-
- // The link implementation is the default link interface.
- if (cmLinkImplementationLibraries const* impl =
- this->GetLinkImplementationLibrariesInternal(config, headTarget,
- usage)) {
- iface.Libraries.insert(iface.Libraries.end(), impl->Libraries.begin(),
- impl->Libraries.end());
- if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
- !this->PolicyWarnedCMP0022 && usage == UseTo::Link) {
- // Compare the link implementation fallback link interface to the
- // preferred new link interface property and warn if different.
- cmLinkInterface ifaceNew;
- this->ExpandLinkItems(
- kINTERFACE_LINK_LIBRARIES, this->Target->GetLinkInterfaceEntries(),
- config, headTarget, usage, LinkInterfaceField::Libraries, ifaceNew);
- if (ifaceNew.Libraries != iface.Libraries) {
- std::string oldLibraries = cmJoin(impl->Libraries, ";");
- std::string newLibraries = cmJoin(ifaceNew.Libraries, ";");
- if (oldLibraries.empty()) {
- oldLibraries = "(empty)";
- }
- if (newLibraries.empty()) {
- newLibraries = "(empty)";
- }
-
- std::ostringstream w;
- /* clang-format off */
- w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0022) << "\n"
- "Target \"" << this->GetName() << "\" has an "
- "INTERFACE_LINK_LIBRARIES property. "
- "This should be preferred as the source of the link interface "
- "for this library but because CMP0022 is not set CMake is "
- "ignoring the property and using the link implementation "
- "as the link interface instead."
- "\n"
- "INTERFACE_LINK_LIBRARIES:\n"
- " " << newLibraries << "\n"
- "Link implementation:\n"
- " " << oldLibraries << "\n";
- /* clang-format on */
- this->LocalGenerator->IssueMessage(MessageType::AUTHOR_WARNING,
- w.str());
- this->PolicyWarnedCMP0022 = true;
- }
- }
- }
+ // The interface libraries are specified by INTERFACE_LINK_LIBRARIES.
+ // Use its special representation directly to get backtraces.
+ this->ExpandLinkItems(
+ kINTERFACE_LINK_LIBRARIES, this->Target->GetLinkInterfaceEntries(), config,
+ headTarget, usage, LinkInterfaceField::Libraries, iface);
+ this->ExpandLinkItems(kINTERFACE_LINK_LIBRARIES_DIRECT,
+ this->Target->GetLinkInterfaceDirectEntries(), config,
+ headTarget, usage, LinkInterfaceField::HeadInclude,
+ iface);
+ this->ExpandLinkItems(kINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE,
+ this->Target->GetLinkInterfaceDirectExcludeEntries(),
+ config, headTarget, usage,
+ LinkInterfaceField::HeadExclude, iface);
}
namespace {
@@ -964,7 +816,7 @@
inline cmLinkImplItem constructItem(cmGeneratorTarget* target,
cmListFileBacktrace const& bt)
{
- return cmLinkImplItem(cmLinkItem(target, false, bt), false);
+ return cmLinkImplItem(cmLinkItem(target, false, bt));
}
template <>
@@ -1120,18 +972,18 @@
return nullptr;
}
- HeadToLinkImplementationMap& hm =
+ cmOptionalLinkImplementation& impl =
(usage == UseTo::Compile
- ? this->GetHeadToLinkImplementationUsageRequirementsMap(config)
- : this->GetHeadToLinkImplementationMap(config));
- cmOptionalLinkImplementation& impl = hm[this];
+ ? this
+ ->LinkImplUsageRequirementsOnlyMap[cmSystemTools::UpperCase(config)]
+ : this->LinkImplMap[cmSystemTools::UpperCase(config)]);
if (secondPass) {
impl = cmOptionalLinkImplementation();
}
MaybeEnableCheckLinkLibraries(impl);
if (!impl.LibrariesDone) {
impl.LibrariesDone = true;
- this->ComputeLinkImplementationLibraries(config, impl, this, usage);
+ this->ComputeLinkImplementationLibraries(config, impl, usage);
}
if (!impl.LanguagesDone) {
impl.LanguagesDone = true;
@@ -1141,54 +993,25 @@
return &impl;
}
-cmGeneratorTarget::HeadToLinkImplementationMap&
-cmGeneratorTarget::GetHeadToLinkImplementationMap(
- std::string const& config) const
-{
- return this->LinkImplMap[cmSystemTools::UpperCase(config)];
-}
-
-cmGeneratorTarget::HeadToLinkImplementationMap&
-cmGeneratorTarget::GetHeadToLinkImplementationUsageRequirementsMap(
- std::string const& config) const
-{
- return this
- ->LinkImplUsageRequirementsOnlyMap[cmSystemTools::UpperCase(config)];
-}
-
cmLinkImplementationLibraries const*
cmGeneratorTarget::GetLinkImplementationLibraries(const std::string& config,
UseTo usage) const
{
- return this->GetLinkImplementationLibrariesInternal(config, this, usage);
-}
-
-cmLinkImplementationLibraries const*
-cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
- const std::string& config, cmGeneratorTarget const* head, UseTo usage) const
-{
// There is no link implementation for targets that cannot compile sources.
if (!this->CanCompileSources()) {
return nullptr;
}
// Populate the link implementation libraries for this configuration.
- HeadToLinkImplementationMap& hm =
+ cmOptionalLinkImplementation& impl =
(usage == UseTo::Compile
- ? this->GetHeadToLinkImplementationUsageRequirementsMap(config)
- : this->GetHeadToLinkImplementationMap(config));
-
- // If the link implementation does not depend on the head target
- // then reuse the one from the head we computed first.
- if (!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) {
- head = hm.begin()->first;
- }
-
- cmOptionalLinkImplementation& impl = hm[head];
+ ? this
+ ->LinkImplUsageRequirementsOnlyMap[cmSystemTools::UpperCase(config)]
+ : this->LinkImplMap[cmSystemTools::UpperCase(config)]);
MaybeEnableCheckLinkLibraries(impl);
if (!impl.LibrariesDone) {
impl.LibrariesDone = true;
- this->ComputeLinkImplementationLibraries(config, impl, head, usage);
+ this->ComputeLinkImplementationLibraries(config, impl, usage);
}
return &impl;
}
@@ -1222,9 +1045,7 @@
void TransitiveLinkImpl::Follow(cmGeneratorTarget const* target)
{
- if (!target || !this->Followed.insert(target).second ||
- target->GetPolicyStatusCMP0022() == cmPolicies::OLD ||
- target->GetPolicyStatusCMP0022() == cmPolicies::WARN) {
+ if (!target || !this->Followed.insert(target).second) {
return;
}
@@ -1246,7 +1067,7 @@
// Add the item itself, but at most once.
if (this->Emitted.insert(item).second) {
- this->Impl.Libraries.emplace_back(item, /* checkCMP0027= */ false);
+ this->Impl.Libraries.emplace_back(item);
}
}
@@ -1303,7 +1124,7 @@
void cmGeneratorTarget::ComputeLinkImplementationLibraries(
const std::string& config, cmOptionalLinkImplementation& impl,
- cmGeneratorTarget const* head, UseTo usage) const
+ UseTo usage) const
{
cmLocalGenerator const* lg = this->LocalGenerator;
cmMakefile const* mf = lg->GetMakefile();
@@ -1333,9 +1154,8 @@
ge.Parse(entry.Value);
cge->SetEvaluateForBuildsystem(true);
std::string const& evaluated =
- cge->Evaluate(this->LocalGenerator, config, head, &dagChecker, nullptr,
+ cge->Evaluate(this->LocalGenerator, config, this, &dagChecker, nullptr,
this->LinkerLanguage);
- bool const checkCMP0027 = evaluated != entry.Value;
cmList llibs(evaluated);
if (cge->GetHadHeadSensitiveCondition()) {
impl.HadHeadSensitiveCondition = true;
@@ -1369,30 +1189,11 @@
}
if (name == this->GetName() || name.empty()) {
if (name == this->GetName()) {
- bool noMessage = false;
- MessageType messageType = MessageType::FATAL_ERROR;
- std::ostringstream e;
- switch (this->GetPolicyStatusCMP0038()) {
- case cmPolicies::WARN: {
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0038) << "\n";
- messageType = MessageType::AUTHOR_WARNING;
- } break;
- case cmPolicies::OLD:
- noMessage = true;
- break;
- case cmPolicies::NEW:
- // Issue the fatal message.
- break;
- }
-
- if (!noMessage) {
- e << "Target \"" << this->GetName() << "\" links to itself.";
- this->LocalGenerator->GetCMakeInstance()->IssueMessage(
- messageType, e.str(), this->GetBacktrace());
- if (messageType == MessageType::FATAL_ERROR) {
- return;
- }
- }
+ this->LocalGenerator->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("Target \"", this->GetName(), "\" links to itself."),
+ this->GetBacktrace());
+ return;
}
continue;
}
@@ -1405,7 +1206,7 @@
if (depsForTarget != synthTargetsForConfig.end()) {
for (auto const* depForTarget : depsForTarget->second) {
cmLinkItem synthItem(depForTarget, item.Cross, item.Backtrace);
- impl.Libraries.emplace_back(std::move(synthItem), false);
+ impl.Libraries.emplace_back(std::move(synthItem));
}
}
} else {
@@ -1422,7 +1223,7 @@
}
}
- impl.Libraries.emplace_back(std::move(item), checkCMP0027);
+ impl.Libraries.emplace_back(std::move(item));
}
std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();
@@ -1435,9 +1236,7 @@
}
// Update the list of direct link dependencies from usage requirements.
- if (head == this) {
- ComputeLinkImplTransitive(this, config, usage, impl);
- }
+ ComputeLinkImplTransitive(this, config, usage, impl);
// Get the list of configurations considered to be DEBUG.
std::vector<std::string> debugConfigs =
@@ -1459,9 +1258,6 @@
if (name == this->GetName() || name.empty()) {
continue;
}
- // Support OLD behavior for CMP0003.
- impl.WrongConfigLibraries.push_back(
- this->ResolveLinkItem(BT<std::string>(name), linkFeature));
}
}
}
diff --git a/Source/cmGeneratorTarget_LinkDirectories.cxx b/Source/cmGeneratorTarget_LinkDirectories.cxx
index 5882aca..47b4e64 100644
--- a/Source/cmGeneratorTarget_LinkDirectories.cxx
+++ b/Source/cmGeneratorTarget_LinkDirectories.cxx
@@ -15,7 +15,6 @@
#include "cmEvaluatedTargetProperty.h"
#include "cmGeneratorExpressionDAGChecker.h"
-#include "cmGlobalGenerator.h"
#include "cmLinkItem.h"
#include "cmList.h"
#include "cmListFileCache.h"
@@ -131,9 +130,7 @@
bool debugDirectories = !this->DebugLinkDirectoriesDone &&
cm::contains(debugProperties, "LINK_DIRECTORIES");
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugLinkDirectoriesDone = true;
- }
+ this->DebugLinkDirectoriesDone = true;
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, language, &dagChecker, this->LinkDirectoriesEntries);
diff --git a/Source/cmGeneratorTarget_Options.cxx b/Source/cmGeneratorTarget_Options.cxx
index d71146d..f9fa94b 100644
--- a/Source/cmGeneratorTarget_Options.cxx
+++ b/Source/cmGeneratorTarget_Options.cxx
@@ -4,8 +4,6 @@
#include "cmGeneratorTarget.h"
/* clang-format on */
-#include "cmConfigure.h"
-
#include <algorithm>
#include <iterator>
#include <map>
@@ -21,7 +19,6 @@
#include "cmEvaluatedTargetProperty.h"
#include "cmGeneratorExpressionDAGChecker.h"
-#include "cmGlobalGenerator.h"
#include "cmList.h"
#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
@@ -241,9 +238,7 @@
bool debugOptions = !this->DebugCompileOptionsDone &&
cm::contains(debugProperties, "COMPILE_OPTIONS");
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugCompileOptionsDone = true;
- }
+ this->DebugCompileOptionsDone = true;
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, language, &dagChecker, this->CompileOptionsEntries);
@@ -282,9 +277,7 @@
bool debugFeatures = !this->DebugCompileFeaturesDone &&
cm::contains(debugProperties, "COMPILE_FEATURES");
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugCompileFeaturesDone = true;
- }
+ this->DebugCompileFeaturesDone = true;
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, std::string(), &dagChecker, this->CompileFeaturesEntries);
@@ -333,9 +326,7 @@
bool debugDefines = !this->DebugCompileDefinitionsDone &&
cm::contains(debugProperties, "COMPILE_DEFINITIONS");
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugCompileDefinitionsDone = true;
- }
+ this->DebugCompileDefinitionsDone = true;
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, language, &dagChecker, this->CompileDefinitionsEntries);
@@ -343,31 +334,6 @@
AddInterfaceEntries(this, config, "INTERFACE_COMPILE_DEFINITIONS", language,
&dagChecker, entries, IncludeRuntimeInterface::Yes);
- if (!config.empty()) {
- std::string configPropName =
- "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config);
- cmValue configProp = this->GetProperty(configPropName);
- if (configProp) {
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0043)) {
- case cmPolicies::WARN: {
- this->LocalGenerator->IssueMessage(
- MessageType::AUTHOR_WARNING,
- cmPolicies::GetPolicyWarning(cmPolicies::CMP0043));
- CM_FALLTHROUGH;
- }
- case cmPolicies::OLD: {
- std::unique_ptr<TargetPropertyEntry> entry =
- TargetPropertyEntry::Create(
- *this->LocalGenerator->GetCMakeInstance(), *configProp);
- entries.Entries.emplace_back(EvaluateTargetPropertyEntry(
- this, config, language, &dagChecker, *entry));
- } break;
- case cmPolicies::NEW:
- break;
- }
- }
- }
-
processOptions(this, entries, list, uniqueOptions, debugDefines,
"compile definitions", OptionsParse::None);
@@ -397,9 +363,7 @@
std::find(debugProperties.begin(), debugProperties.end(),
"PRECOMPILE_HEADERS") != debugProperties.end();
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugPrecompileHeadersDone = true;
- }
+ this->DebugPrecompileHeadersDone = true;
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, language, &dagChecker, this->PrecompileHeadersEntries);
@@ -454,9 +418,7 @@
bool debugOptions = !this->DebugLinkOptionsDone &&
cm::contains(debugProperties, "LINK_OPTIONS");
- if (this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- this->DebugLinkOptionsDone = true;
- }
+ this->DebugLinkOptionsDone = true;
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, language, &dagChecker, this->LinkOptionsEntries);
diff --git a/Source/cmGeneratorTarget_Sources.cxx b/Source/cmGeneratorTarget_Sources.cxx
index 94e8897..866627a 100644
--- a/Source/cmGeneratorTarget_Sources.cxx
+++ b/Source/cmGeneratorTarget_Sources.cxx
@@ -37,7 +37,6 @@
#include "cmSourceFileLocation.h"
#include "cmSourceGroup.h"
#include "cmStateTypes.h"
-#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
@@ -234,35 +233,12 @@
{
std::vector<BT<std::string>> files;
- if (!this->LocalGenerator->GetGlobalGenerator()->GetConfigureDoneCMP0026()) {
- // At configure-time, this method can be called as part of getting the
- // LOCATION property or to export() a file to be include()d. However
- // there is no cmGeneratorTarget at configure-time, so search the SOURCES
- // for TARGET_OBJECTS instead for backwards compatibility with OLD
- // behavior of CMP0024 and CMP0026 only.
-
- cmBTStringRange sourceEntries = this->Target->GetSourceEntries();
- for (auto const& entry : sourceEntries) {
- cmList items{ entry.Value };
- for (auto const& item : items) {
- if (cmHasLiteralPrefix(item, "$<TARGET_OBJECTS:") &&
- item.back() == '>') {
- continue;
- }
- files.emplace_back(item);
- }
- }
- return files;
- }
-
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
bool debugSources =
!this->DebugSourcesDone && cm::contains(debugProperties, "SOURCES");
- if (this->LocalGenerator->GetGlobalGenerator()->GetConfigureDoneCMP0026()) {
- this->DebugSourcesDone = true;
- }
+ this->DebugSourcesDone = true;
cmGeneratorExpressionDAGChecker dagChecker(this, "SOURCES", nullptr, nullptr,
this->LocalGenerator, config);
@@ -326,24 +302,6 @@
std::string const& config) const
{
std::vector<BT<cmSourceFile*>> files;
- if (!this->GlobalGenerator->GetConfigureDoneCMP0026()) {
- // Since we are still configuring not all sources may exist yet,
- // so we need to avoid full source classification because that
- // requires the absolute paths to all sources to be determined.
- // Since this is only for compatibility with old policies that
- // projects should not depend on anymore, just compute the files
- // without memoizing them.
- std::vector<BT<std::string>> srcs = this->GetSourceFilePaths(config);
- std::set<cmSourceFile*> emitted;
- for (BT<std::string> const& s : srcs) {
- cmSourceFile* sf = this->Makefile->GetOrCreateSource(s.Value);
- if (emitted.insert(sf).second) {
- files.emplace_back(sf, s.Backtrace);
- }
- }
- return files;
- }
-
KindedSources const& kinded = this->GetKindedSources(config);
files.reserve(kinded.Sources.size());
for (SourceAndKind const& si : kinded.Sources) {
diff --git a/Source/cmGeneratorTarget_TransitiveProperty.cxx b/Source/cmGeneratorTarget_TransitiveProperty.cxx
index ac929eb..e16f04d 100644
--- a/Source/cmGeneratorTarget_TransitiveProperty.cxx
+++ b/Source/cmGeneratorTarget_TransitiveProperty.cxx
@@ -202,13 +202,6 @@
result->Usage = cmGeneratorTarget::UseTo::Compile;
}
}
- } else if (cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_")) {
- cmPolicies::PolicyStatus cmp0043 =
- lg->GetPolicyStatus(cmPolicies::CMP0043);
- if (cmp0043 == cmPolicies::WARN || cmp0043 == cmPolicies::OLD) {
- result = TransitiveProperty{ "INTERFACE_COMPILE_DEFINITIONS"_s,
- UseTo::Compile };
- }
} else if (!evaluatingLinkLibraries) {
// Honor TRANSITIVE_COMPILE_PROPERTIES and TRANSITIVE_LINK_PROPERTIES
// from the link closure when we are not evaluating the closure itself.
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index db26860..a244978 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -2,13 +2,11 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGetTargetPropertyCommand.h"
-#include <sstream>
-
#include "cmExecutionStatus.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
-#include "cmPolicies.h"
+#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include "cmValue.h"
@@ -50,29 +48,11 @@
}
}
} else {
- bool issueMessage = false;
- std::ostringstream e;
- MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (mf.GetPolicyStatus(cmPolicies::CMP0045)) {
- case cmPolicies::WARN:
- issueMessage = true;
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0045) << "\n";
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- issueMessage = true;
- messageType = MessageType::FATAL_ERROR;
- break;
- }
- if (issueMessage) {
- e << "get_target_property() called with non-existent target \""
- << targetName << "\".";
- mf.IssueMessage(messageType, e.str());
- if (messageType == MessageType::FATAL_ERROR) {
- return false;
- }
- }
+ mf.IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("get_target_property() called with non-existent target \"",
+ targetName, "\"."));
+ return false;
}
if (prop_exists) {
mf.AddDefinition(var, prop);
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 60679ba..4b1e895 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -203,7 +203,7 @@
std::string flags;
this->LocalGenerator->AddLanguageFlags(
flags, this->GeneratorTarget, cmBuildStep::Compile, language, config);
- this->LocalGenerator->AddCMP0018Flags(flags, this->GeneratorTarget,
+ this->LocalGenerator->AddFeatureFlags(flags, this->GeneratorTarget,
language, config);
this->LocalGenerator->AddVisibilityPresetFlags(
flags, this->GeneratorTarget, language);
diff --git a/Source/cmGlobVerificationManager.cxx b/Source/cmGlobVerificationManager.cxx
index 73365d2..7f16004 100644
--- a/Source/cmGlobVerificationManager.cxx
+++ b/Source/cmGlobVerificationManager.cxx
@@ -42,8 +42,6 @@
<< 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);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index eed22d3..c3c4837 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -129,7 +129,6 @@
this->CurrentConfigureMakefile = nullptr;
this->TryCompileOuterMakefile = nullptr;
- this->ConfigureDoneCMP0026AndCMP0024 = false;
this->FirstTimeProgress = 0.0f;
cm->GetState()->SetIsGeneratorMultiConfig(false);
@@ -315,24 +314,6 @@
this->AddBuildExportSet(gen);
}
-bool cmGlobalGenerator::GenerateImportFile(const std::string& file)
-{
- auto const it = this->BuildExportSets.find(file);
- if (it != this->BuildExportSets.end()) {
- bool result = it->second->GenerateImportFile();
-
- if (!this->ConfigureDoneCMP0026AndCMP0024) {
- for (const auto& m : this->Makefiles) {
- m->RemoveExportBuildFileGeneratorCMP0024(it->second);
- }
- }
-
- this->BuildExportSets.erase(it);
- return result;
- }
- return false;
-}
-
void cmGlobalGenerator::ForceLinkerLanguages()
{
}
@@ -981,12 +962,6 @@
}
}
- // Store the shared library flags so that we can satisfy CMP0018
- std::string sharedLibFlagsVar =
- cmStrCat("CMAKE_SHARED_LIBRARY_", lang, "_FLAGS");
- this->LanguageToOriginalSharedLibFlags[lang] =
- mf->GetSafeDefinition(sharedLibFlagsVar);
-
// Translate compiler ids for compatibility.
this->CheckCompilerIdCompatibility(mf, lang);
} // end for each language
@@ -1035,61 +1010,6 @@
std::string compilerIdVar = cmStrCat("CMAKE_", lang, "_COMPILER_ID");
std::string const compilerId = mf->GetSafeDefinition(compilerIdVar);
- if (compilerId == "AppleClang") {
- switch (mf->GetPolicyStatus(cmPolicies::CMP0025)) {
- case cmPolicies::WARN:
- if (!this->CMakeInstance->GetIsInTryCompile() &&
- mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025")) {
- std::ostringstream w;
- /* clang-format off */
- w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0025) << "\n"
- "Converting " << lang <<
- R"( compiler id "AppleClang" to "Clang" for compatibility.)"
- ;
- /* clang-format on */
- mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
- }
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- // OLD behavior is to convert AppleClang to Clang.
- mf->AddDefinition(compilerIdVar, "Clang");
- break;
- case cmPolicies::NEW:
- // NEW behavior is to keep AppleClang.
- break;
- }
- }
-
- if (compilerId == "QCC") {
- switch (mf->GetPolicyStatus(cmPolicies::CMP0047)) {
- case cmPolicies::WARN:
- if (!this->CMakeInstance->GetIsInTryCompile() &&
- mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) {
- std::ostringstream w;
- /* clang-format off */
- w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0047) << "\n"
- "Converting " << lang <<
- R"( compiler id "QCC" to "GNU" for compatibility.)"
- ;
- /* clang-format on */
- mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
- }
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- // OLD behavior is to convert QCC to GNU.
- mf->AddDefinition(compilerIdVar, "GNU");
- if (lang == "C") {
- mf->AddDefinition("CMAKE_COMPILER_IS_GNUCC", "1");
- } else if (lang == "CXX") {
- mf->AddDefinition("CMAKE_COMPILER_IS_GNUCXX", "1");
- }
- break;
- case cmPolicies::NEW:
- // NEW behavior is to keep QCC.
- break;
- }
- }
-
if (compilerId == "XLClang") {
switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) {
case cmPolicies::WARN:
@@ -1389,12 +1309,9 @@
}
// now do it
- this->ConfigureDoneCMP0026AndCMP0024 = false;
dirMf->Configure();
dirMf->EnforceDirectoryLevelRules();
- this->ConfigureDoneCMP0026AndCMP0024 = true;
-
// Put a copy of each global target in every directory.
{
std::vector<GlobalTargetInfo> globalTargets;
@@ -1420,7 +1337,7 @@
{
this->CreateLocalGenerators();
// Commit side effects only if we are actually generating
- if (this->GetConfigureDoneCMP0026()) {
+ if (targetTypes == TargetTypes::AllTargets) {
this->CheckTargetProperties();
}
this->CreateGeneratorTargets(targetTypes);
@@ -1456,11 +1373,6 @@
return it == this->BuildExportSets.end() ? nullptr : it->second;
}
-void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target)
-{
- this->CMP0042WarnTargets.insert(target);
-}
-
void cmGlobalGenerator::AddCMP0068WarnTarget(const std::string& target)
{
this->CMP0068WarnTargets.insert(target);
@@ -1543,8 +1455,6 @@
// Start with an empty vector:
this->FilesReplacedDuringGenerate.clear();
- // clear targets to issue warning CMP0042 for
- this->CMP0042WarnTargets.clear();
// clear targets to issue warning CMP0068 for
this->CMP0068WarnTargets.clear();
@@ -1750,19 +1660,6 @@
// Perform validation checks on memoized link structures.
this->CheckTargetLinkLibraries();
- if (!this->CMP0042WarnTargets.empty()) {
- std::ostringstream w;
- w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0042)
- << "\n"
- "MACOSX_RPATH is not specified for"
- " the following targets:\n";
- for (std::string const& t : this->CMP0042WarnTargets) {
- w << ' ' << t << '\n';
- }
- this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
- w.str());
- }
-
if (!this->CMP0068WarnTargets.empty()) {
std::ostringstream w;
/* clang-format off */
@@ -2011,14 +1908,11 @@
// Construct per-target generator information.
for (const auto& mf : this->Makefiles) {
- const cmBTStringRange noConfigCompileDefinitions =
+ const cmBTStringRange compileDefinitions =
mf->GetCompileDefinitionsEntries();
- cm::optional<std::map<std::string, cmValue>> perConfigCompileDefinitions;
-
for (auto& target : mf->GetTargets()) {
cmTarget* t = &target.second;
- t->FinalizeTargetConfiguration(noConfigCompileDefinitions,
- perConfigCompileDefinitions);
+ t->FinalizeTargetConfiguration(compileDefinitions);
}
// The standard include directories for each language
@@ -2779,58 +2673,38 @@
return cm::nullopt;
}
-static bool RaiseCMP0037Message(cmake* cm, cmTarget* tgt,
- std::string const& targetNameAsWritten,
- std::string const& reason)
+namespace {
+void IssueReservedTargetNameError(cmake* cm, cmTarget* tgt,
+ std::string const& targetNameAsWritten,
+ std::string const& reason)
{
- MessageType messageType = MessageType::AUTHOR_WARNING;
- std::ostringstream e;
- bool issueMessage = false;
- switch (tgt->GetPolicyStatusCMP0037()) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0037) << '\n';
- issueMessage = true;
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- issueMessage = true;
- messageType = MessageType::FATAL_ERROR;
- break;
- }
- if (issueMessage) {
- e << "The target name \"" << targetNameAsWritten << "\" is reserved "
- << reason << '.';
- if (messageType == MessageType::AUTHOR_WARNING) {
- e << " It may result in undefined behavior.";
- }
- cm->IssueMessage(messageType, e.str(), tgt->GetBacktrace());
- if (messageType == MessageType::FATAL_ERROR) {
- return false;
- }
- }
- return true;
+ cm->IssueMessage(MessageType::FATAL_ERROR,
+ cmStrCat("The target name \"", targetNameAsWritten,
+ "\" is reserved ", reason, '.'),
+ tgt->GetBacktrace());
+}
}
-bool cmGlobalGenerator::CheckCMP0037(std::string const& targetName,
- std::string const& reason) const
+bool cmGlobalGenerator::CheckReservedTargetName(
+ std::string const& targetName, std::string const& reason) const
{
cmTarget* tgt = this->FindTarget(targetName);
if (!tgt) {
return true;
}
- return RaiseCMP0037Message(this->GetCMakeInstance(), tgt, targetName,
- reason);
+ IssueReservedTargetNameError(this->GetCMakeInstance(), tgt, targetName,
+ reason);
+ return false;
}
-bool cmGlobalGenerator::CheckCMP0037Prefix(std::string const& targetPrefix,
- std::string const& reason) const
+bool cmGlobalGenerator::CheckReservedTargetNamePrefix(
+ std::string const& targetPrefix, std::string const& reason) const
{
bool ret = true;
for (auto const& tgtPair : this->TargetSearchIndex) {
- if (cmHasPrefix(tgtPair.first, targetPrefix) &&
- !RaiseCMP0037Message(this->GetCMakeInstance(), tgtPair.second,
- tgtPair.first, reason)) {
+ if (cmHasPrefix(tgtPair.first, targetPrefix)) {
+ IssueReservedTargetNameError(this->GetCMakeInstance(), tgtPair.second,
+ tgtPair.first, reason);
ret = false;
}
}
@@ -2860,7 +2734,8 @@
static const auto reservedTargets = { "package", "PACKAGE" };
for (auto const& target : reservedTargets) {
- if (!this->CheckCMP0037(target, "when CPack packaging is enabled")) {
+ if (!this->CheckReservedTargetName(target,
+ "when CPack packaging is enabled")) {
return;
}
}
@@ -2909,8 +2784,8 @@
static const auto reservedTargets = { "package_source" };
for (auto const& target : reservedTargets) {
- if (!this->CheckCMP0037(target,
- "when CPack source packaging is enabled")) {
+ if (!this->CheckReservedTargetName(
+ target, "when CPack source packaging is enabled")) {
return;
}
}
@@ -2939,7 +2814,8 @@
static const auto reservedTargets = { "test", "RUN_TESTS" };
for (auto const& target : reservedTargets) {
- if (!this->CheckCMP0037(target, "when CTest testing is enabled")) {
+ if (!this->CheckReservedTargetName(target,
+ "when CTest testing is enabled")) {
return;
}
}
@@ -3298,14 +3174,14 @@
static const auto reservedTargets = { "cmake_build_database" };
for (auto const& target : reservedTargets) {
- if (!this->CheckCMP0037(target,
- "when exporting build databases are enabled")) {
+ if (!this->CheckReservedTargetName(
+ target, "when exporting build databases are enabled")) {
return false;
}
}
static const auto reservedPrefixes = { "cmake_build_database-" };
for (auto const& prefix : reservedPrefixes) {
- if (!this->CheckCMP0037Prefix(
+ if (!this->CheckReservedTargetNamePrefix(
prefix, "when exporting build databases are enabled")) {
return false;
}
@@ -3475,16 +3351,6 @@
return mf->PlatformIsAppleEmbedded();
}
-std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage(
- std::string const& l) const
-{
- auto const it = this->LanguageToOriginalSharedLibFlags.find(l);
- if (it != this->LanguageToOriginalSharedLibFlags.end()) {
- return it->second;
- }
- return "";
-}
-
void cmGlobalGenerator::AppendDirectoryForConfig(const std::string& /*unused*/,
const std::string& /*unused*/,
const std::string& /*unused*/,
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index c0f0fdf..fde09ea 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -591,8 +591,6 @@
virtual bool SupportsLinkerDependencyFile() const { return false; }
- std::string GetSharedLibFlagsForLanguage(std::string const& lang) const;
-
/** Generate an <output>.rule file path for a given command output. */
virtual std::string GenerateRuleFile(std::string const& output) const;
@@ -623,10 +621,8 @@
void AddBuildExportSet(cmExportBuildFileGenerator* gen);
void AddBuildExportExportSet(cmExportBuildFileGenerator* gen);
bool IsExportedTargetsFile(const std::string& filename) const;
- bool GenerateImportFile(const std::string& file);
cmExportBuildFileGenerator* GetExportedTargetsFile(
const std::string& filename) const;
- void AddCMP0042WarnTarget(const std::string& target);
void AddCMP0068WarnTarget(const std::string& target);
virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
@@ -642,11 +638,6 @@
cmFileLockPool& GetFileLockPool() { return this->FileLockPool; }
#endif
- bool GetConfigureDoneCMP0026() const
- {
- return this->ConfigureDoneCMP0026AndCMP0024;
- }
-
std::string MakeSilentFlag;
size_t RecursionDepth = 0;
@@ -826,7 +817,6 @@
std::map<std::string, std::string> LanguageToOutputExtension;
std::map<std::string, std::string> ExtensionToLanguage;
std::map<std::string, int> LanguageToLinkerPreference;
- std::map<std::string, std::string> LanguageToOriginalSharedLibFlags;
#if !defined(CMAKE_BOOTSTRAP)
std::unique_ptr<Json::StreamWriter> JsonWriter;
@@ -884,10 +874,10 @@
void ClearGeneratorMembers();
- bool CheckCMP0037(std::string const& targetName,
- std::string const& reason) const;
- bool CheckCMP0037Prefix(std::string const& targetPrefix,
- std::string const& reason) const;
+ bool CheckReservedTargetName(std::string const& targetName,
+ std::string const& reason) const;
+ bool CheckReservedTargetNamePrefix(std::string const& targetPrefix,
+ std::string const& reason) const;
void IndexMakefile(cmMakefile* mf);
void IndexLocalGenerator(cmLocalGenerator* lg);
@@ -909,8 +899,6 @@
// Set of binary directories on disk.
std::set<std::string> BinaryDirectories;
- // track targets to issue CMP0042 warning for.
- std::set<std::string> CMP0042WarnTargets;
// track targets to issue CMP0068 warning for.
std::set<std::string> CMP0068WarnTargets;
@@ -948,6 +936,5 @@
bool ForceUnixPaths;
bool ToolSupportsColor;
bool InstallTargetEnabled;
- bool ConfigureDoneCMP0026AndCMP0024;
bool AllowGlobalTargetCodegen;
};
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index daef821..ef5534f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2421,8 +2421,7 @@
this->CurrentLocalGenerator->AppendFeatureOptions(flags, lang, "IPO");
}
- // Add shared-library flags if needed.
- this->CurrentLocalGenerator->AddCMP0018Flags(flags, gtgt, lang,
+ this->CurrentLocalGenerator->AddFeatureFlags(flags, gtgt, lang,
configName);
this->CurrentLocalGenerator->AddVisibilityPresetFlags(flags, gtgt, lang);
@@ -4911,7 +4910,7 @@
}
std::vector<cmGeneratorTarget*> objlibs;
- gt->GetObjectLibrariesCMP0026(objlibs);
+ gt->GetObjectLibrariesInSources(objlibs);
for (auto* objLib : objlibs) {
makefileStream << this->PostBuildMakeTarget(objLib->GetName(),
configName)
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 23ca4ce..f896468 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -3,7 +3,6 @@
#include "cmIncludeCommand.h"
#include <map>
-#include <sstream>
#include <utility>
#include "cmExecutionStatus.h"
@@ -117,36 +116,15 @@
cmGlobalGenerator* gg = status.GetMakefile().GetGlobalGenerator();
if (gg->IsExportedTargetsFile(fname_abs)) {
- const char* modal = nullptr;
- std::ostringstream e;
- MessageType messageType = MessageType::AUTHOR_WARNING;
-
- switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0024)) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0024) << "\n";
- modal = "should";
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- modal = "may";
- messageType = MessageType::FATAL_ERROR;
- }
- if (modal) {
- e << "The file\n " << fname_abs
- << "\nwas generated by the export() "
- "command. It "
- << modal
- << " not be used as the argument to the "
- "include() command. Use ALIAS targets instead to refer to targets "
- "by alternative names.\n";
- status.GetMakefile().IssueMessage(messageType, e.str());
- if (messageType == MessageType::FATAL_ERROR) {
- return false;
- }
- }
- gg->CreateGenerationObjects();
- gg->GenerateImportFile(fname_abs);
+ status.GetMakefile().IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "The file\n ", fname_abs,
+ "\nwas generated by the export() "
+ "command. It may not be used as the argument to the "
+ "include() command. Use ALIAS targets instead to refer to targets "
+ "by alternative names.\n"));
+ return false;
}
std::string listFile = cmSystemTools::CollapseFullPath(
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 7f5a22b..04634ab 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -105,7 +105,6 @@
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 @@
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 "
@@ -2164,23 +2156,6 @@
cmExportSet& exportSet =
helper.Makefile->GetGlobalGenerator()->GetExportSets()[exp];
- if (exportOld) {
- for (auto const& te : exportSet.GetTargetExports()) {
- cmTarget* tgt =
- helper.Makefile->GetGlobalGenerator()->FindTarget(te->TargetName);
- const bool newCMP0022Behavior =
- (tgt && tgt->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- tgt->GetPolicyStatusCMP0022() != cmPolicies::OLD);
-
- if (!newCMP0022Behavior) {
- status.SetError(cmStrCat(
- "INSTALL(EXPORT) given keyword \""
- "EXPORT_LINK_INTERFACE_LIBRARIES\", but target \"",
- te->TargetName, "\" does not have policy CMP0022 set to NEW."));
- return false;
- }
- }
- }
cmInstallGenerator::MessageLevel message =
cmInstallGenerator::SelectMessageLevel(helper.Makefile);
@@ -2482,24 +2457,6 @@
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
diff --git a/Source/cmInstrumentation.cxx b/Source/cmInstrumentation.cxx
index c7147c6..bd0d16d 100644
--- a/Source/cmInstrumentation.cxx
+++ b/Source/cmInstrumentation.cxx
@@ -425,6 +425,9 @@
}
if (arrayOptions.has_value()) {
for (auto const& item : arrayOptions.value()) {
+ if (item.first == "targetLabels" && command_type != "link") {
+ continue;
+ }
root[item.first] = Json::arrayValue;
std::stringstream ss(item.second);
std::string element;
diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx
index 395f7ce..d45d495 100644
--- a/Source/cmLinkDirectoriesCommand.cxx
+++ b/Source/cmLinkDirectoriesCommand.cxx
@@ -2,14 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmLinkDirectoriesCommand.h"
-#include <sstream>
-
#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
#include "cmList.h"
#include "cmMakefile.h"
-#include "cmMessageType.h"
-#include "cmPolicies.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -52,29 +48,7 @@
cmSystemTools::ConvertToUnixSlashes(unixPath);
if (!cmSystemTools::FileIsFullPath(unixPath) &&
!cmGeneratorExpression::StartsWithGeneratorExpression(unixPath)) {
- bool convertToAbsolute = false;
- std::ostringstream e;
- /* clang-format off */
- e << "This command specifies the relative path\n"
- << " " << unixPath << "\n"
- << "as a link directory.\n";
- /* clang-format on */
- switch (mf.GetPolicyStatus(cmPolicies::CMP0015)) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0015);
- mf.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- // OLD behavior does not convert
- break;
- case cmPolicies::NEW:
- // NEW behavior converts
- convertToAbsolute = true;
- break;
- }
- if (convertToAbsolute) {
- unixPath = cmStrCat(mf.GetCurrentSourceDirectory(), '/', unixPath);
- }
+ unixPath = cmStrCat(mf.GetCurrentSourceDirectory(), '/', unixPath);
}
directories.push_back(unixPath);
}
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx
index 6744bbb..bee3eae 100644
--- a/Source/cmLinkItem.cxx
+++ b/Source/cmLinkItem.cxx
@@ -71,9 +71,8 @@
return os << item.AsStr();
}
-cmLinkImplItem::cmLinkImplItem(cmLinkItem item, bool checkCMP0027)
+cmLinkImplItem::cmLinkImplItem(cmLinkItem item)
: cmLinkItem(std::move(item))
- , CheckCMP0027(checkCMP0027)
{
}
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index 4ef0566..e3736f9 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -51,8 +51,7 @@
{
public:
cmLinkImplItem() = default;
- cmLinkImplItem(cmLinkItem item, bool checkCMP0027);
- bool CheckCMP0027 = false;
+ cmLinkImplItem(cmLinkItem item);
};
/** The link implementation specifies the direct library
@@ -65,10 +64,6 @@
// 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,12 +103,6 @@
// 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.
bool HadLinkLanguageSensitiveCondition = false;
};
@@ -123,7 +112,6 @@
bool LibrariesDone = false;
bool AllDone = false;
bool Exists = false;
- bool Explicit = false;
bool CheckLinkLibraries = false;
};
diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx
index ca574d4..85d53d8 100644
--- a/Source/cmLinkItemGraphVisitor.cxx
+++ b/Source/cmLinkItemGraphVisitor.cxx
@@ -121,7 +121,7 @@
}
std::vector<cmGeneratorTarget*> objectLibraries;
- target.GetObjectLibrariesCMP0026(objectLibraries);
+ target.GetObjectLibrariesInSources(objectLibraries);
for (auto const& lib : objectLibraries) {
auto const& name = lib->GetName();
if (dependencies.find(name) == dependencies.cend()) {
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 67c6032..7143471 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -89,29 +89,6 @@
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;
}
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
deleted file mode 100644
index 66ea52d..0000000
--- a/Source/cmLoadCommandCommand.cxx
+++ /dev/null
@@ -1,276 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-
-#if !defined(_WIN32) && !defined(__sun) && !defined(__OpenBSD__)
-// POSIX APIs are needed
-// NOLINTNEXTLINE(bugprone-reserved-identifier)
-# define _POSIX_C_SOURCE 200809L
-#endif
-#if defined(__FreeBSD__) || defined(__NetBSD__)
-// For isascii
-// NOLINTNEXTLINE(bugprone-reserved-identifier)
-# define _XOPEN_SOURCE 700
-#endif
-
-#include "cmLoadCommandCommand.h"
-
-#include <csignal>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-#include <cm/memory>
-
-#include "cmCPluginAPI.h"
-#include "cmDynamicLoader.h"
-#include "cmExecutionStatus.h"
-#include "cmListFileCache.h"
-#include "cmLocalGenerator.h"
-#include "cmMakefile.h"
-#include "cmState.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-
-// NOLINTNEXTLINE(bugprone-suspicious-include)
-#include "cmCPluginAPI.cxx"
-
-#ifdef __QNX__
-# include <malloc.h> /* for malloc/free on QNX */
-#endif
-
-#if defined(__clang__) && defined(__has_warning)
-# if __has_warning("-Wcast-function-type-strict")
-# pragma clang diagnostic ignored "-Wcast-function-type-strict"
-# endif
-#endif
-
-namespace {
-
-const char* LastName = nullptr;
-
-extern "C" void TrapsForSignals(int sig);
-extern "C" void TrapsForSignals(int sig)
-{
- fprintf(stderr, "CMake loaded command %s crashed with signal: %d.\n",
- LastName, sig);
-}
-
-struct SignalHandlerGuard
-{
- explicit SignalHandlerGuard(const char* name)
- {
- LastName = name ? name : "????";
-
- signal(SIGSEGV, TrapsForSignals);
-#ifdef SIGBUS
- signal(SIGBUS, TrapsForSignals);
-#endif
- signal(SIGILL, TrapsForSignals);
- }
-
- ~SignalHandlerGuard()
- {
- signal(SIGSEGV, nullptr);
-#ifdef SIGBUS
- signal(SIGBUS, nullptr);
-#endif
- signal(SIGILL, nullptr);
- }
-
- SignalHandlerGuard(SignalHandlerGuard const&) = delete;
- SignalHandlerGuard& operator=(SignalHandlerGuard const&) = delete;
-};
-
-struct LoadedCommandImpl : cmLoadedCommandInfo
-{
- explicit LoadedCommandImpl(CM_INIT_FUNCTION init)
- : cmLoadedCommandInfo{ 0, 0, &cmStaticCAPI, 0,
- nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr }
- {
- init(this);
- }
-
- ~LoadedCommandImpl()
- {
- if (this->Destructor) {
- SignalHandlerGuard guard(this->Name);
-#if defined(__NVCOMPILER) || defined(__LCC__)
- static_cast<void>(guard); // convince compiler var is used
-#endif
- this->Destructor(this);
- }
- if (this->Error) {
- free(this->Error);
- }
- }
-
- LoadedCommandImpl(LoadedCommandImpl const&) = delete;
- LoadedCommandImpl& operator=(LoadedCommandImpl const&) = delete;
-
- int DoInitialPass(cmMakefile* mf, int argc, char* argv[])
- {
- SignalHandlerGuard guard(this->Name);
-#if defined(__NVCOMPILER) || defined(__LCC__)
- static_cast<void>(guard); // convince compiler var is used
-#endif
- return this->InitialPass(this, mf, argc, argv);
- }
-
- void DoFinalPass(cmMakefile* mf)
- {
- SignalHandlerGuard guard(this->Name);
-#if defined(__NVCOMPILER) || defined(__LCC__)
- static_cast<void>(guard); // convince compiler var is used
-#endif
- this->FinalPass(this, mf);
- }
-};
-
-// a class for loadabple commands
-class cmLoadedCommand
-{
-public:
- explicit cmLoadedCommand(CM_INIT_FUNCTION init)
- : Impl(std::make_shared<LoadedCommandImpl>(init))
- {
- }
-
- bool operator()(std::vector<cmListFileArgument> const& args,
- cmExecutionStatus& status) const;
-
-private:
- std::shared_ptr<LoadedCommandImpl> Impl;
-};
-
-bool cmLoadedCommand::operator()(
- std::vector<cmListFileArgument> const& arguments,
- cmExecutionStatus& status) const
-{
- cmMakefile& mf = status.GetMakefile();
-
- std::vector<std::string> args;
- if (!mf.ExpandArguments(arguments, args)) {
- return true;
- }
-
- if (!this->Impl->InitialPass) {
- return true;
- }
-
- // clear the error string
- if (this->Impl->Error) {
- free(this->Impl->Error);
- }
-
- // create argc and argv and then invoke the command
- int argc = static_cast<int>(args.size());
- char** argv = nullptr;
- if (argc) {
- argv = static_cast<char**>(malloc(argc * sizeof(char*)));
- }
- int i;
- for (i = 0; i < argc; ++i) {
- argv[i] = strdup(args[i].c_str());
- }
- int result = this->Impl->DoInitialPass(&mf, argc, argv);
- cmFreeArguments(argc, argv);
-
- if (result) {
- if (this->Impl->FinalPass) {
- auto impl = this->Impl;
- mf.AddGeneratorAction(
- [impl](cmLocalGenerator& lg, const cmListFileBacktrace&) {
- impl->DoFinalPass(lg.GetMakefile());
- });
- }
- return true;
- }
-
- /* Initial Pass must have failed so set the error string */
- if (this->Impl->Error) {
- status.SetError(this->Impl->Error);
- }
- return false;
-}
-
-} // namespace
-
-// cmLoadCommandCommand
-bool cmLoadCommandCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status)
-{
- if (args.empty()) {
- return true;
- }
-
- // Construct a variable to report what file was loaded, if any.
- // Start by removing the definition in case of failure.
- std::string reportVar = cmStrCat("CMAKE_LOADED_COMMAND_", args[0]);
- status.GetMakefile().RemoveDefinition(reportVar);
-
- // the file must exist
- std::string moduleName = cmStrCat(
- status.GetMakefile().GetRequiredDefinition("CMAKE_SHARED_MODULE_PREFIX"),
- "cm", args[0],
- status.GetMakefile().GetRequiredDefinition("CMAKE_SHARED_MODULE_SUFFIX"));
-
- // search for the file
- std::vector<std::string> path;
- for (unsigned int j = 1; j < args.size(); j++) {
- // expand variables
- std::string exp = args[j];
- cmSystemTools::ExpandRegistryValues(exp);
-
- // Glob the entry in case of wildcards.
- cmSystemTools::GlobDirs(exp, path);
- }
-
- // Try to find the program.
- std::string fullPath = cmSystemTools::FindFile(moduleName, path);
- if (fullPath.empty()) {
- status.SetError(cmStrCat("Attempt to load command failed from file \"",
- moduleName, "\""));
- return false;
- }
-
- // try loading the shared library / dll
- cmsys::DynamicLoader::LibraryHandle lib =
- cmDynamicLoader::OpenLibrary(fullPath.c_str());
- if (!lib) {
- std::string err =
- cmStrCat("Attempt to load the library ", fullPath, " failed.");
- const char* error = cmsys::DynamicLoader::LastError();
- if (error) {
- err += " Additional error info is:\n";
- err += error;
- }
- status.SetError(err);
- return false;
- }
-
- // Report what file was loaded for this command.
- status.GetMakefile().AddDefinition(reportVar, fullPath);
-
- // find the init function
- std::string initFuncName = args[0] + "Init";
- CM_INIT_FUNCTION initFunction = reinterpret_cast<CM_INIT_FUNCTION>(
- cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName));
- if (!initFunction) {
- initFuncName = cmStrCat('_', args[0], "Init");
- initFunction = reinterpret_cast<CM_INIT_FUNCTION>(
- cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName));
- }
- // if the symbol is found call it to set the name on the
- // function blocker
- if (initFunction) {
- return status.GetMakefile().GetState()->AddScriptedCommand(
- args[0],
- BT<cmState::Command>(cmLoadedCommand(initFunction),
- status.GetMakefile().GetBacktrace()),
- status.GetMakefile());
- }
- status.SetError("Attempt to load command failed. "
- "No init function found.");
- return false;
-}
diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h
deleted file mode 100644
index d30ba16..0000000
--- a/Source/cmLoadCommandCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmLoadCommandCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1f30e9f..861210c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -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 @@
this->AliasTargets = makefile->GetAliasTargets();
this->EmitUniversalBinaryFlags = true;
- this->BackwardsCompatibility = 0;
- this->BackwardsCompatibilityFinal = false;
this->ComputeObjectMaxPath();
@@ -1752,7 +1749,7 @@
}
}
- this->AddCMP0018Flags(compileFlags, target, lang, config);
+ this->AddFeatureFlags(compileFlags, target, lang, config);
this->AddVisibilityPresetFlags(compileFlags, target, lang);
this->AddColorDiagnosticsFlags(compileFlags, lang);
this->AppendFlags(compileFlags, mf->GetDefineFlags());
@@ -2426,19 +2423,6 @@
return true;
}
-void cmLocalGenerator::AddSharedFlags(std::string& flags,
- const std::string& lang, bool shared)
-{
- std::string flagsVar;
-
- // Add flags for dealing with shared libraries for this language.
- if (shared) {
- this->AppendFlags(flags,
- this->Makefile->GetSafeDefinition(
- cmStrCat("CMAKE_SHARED_LIBRARY_", lang, "_FLAGS")));
- }
-}
-
static void AddVisibilityCompileOption(std::string& flags,
cmGeneratorTarget const* target,
cmLocalGenerator* lg,
@@ -2543,7 +2527,7 @@
}
}
-void cmLocalGenerator::AddCMP0018Flags(std::string& flags,
+void cmLocalGenerator::AddFeatureFlags(std::string& flags,
cmGeneratorTarget const* target,
std::string const& lang,
const std::string& config)
@@ -2553,54 +2537,13 @@
bool shared = ((targetType == cmStateEnums::SHARED_LIBRARY) ||
(targetType == cmStateEnums::MODULE_LIBRARY));
- if (this->GetShouldUseOldFlags(shared, lang)) {
- this->AddSharedFlags(flags, lang, shared);
- } else {
- if (target->GetLinkInterfaceDependentBoolProperty(
- "POSITION_INDEPENDENT_CODE", config)) {
- this->AddPositionIndependentFlags(flags, lang, targetType);
- }
- if (shared) {
- this->AppendFeatureOptions(flags, lang, "DLL");
- }
+ if (target->GetLinkInterfaceDependentBoolProperty(
+ "POSITION_INDEPENDENT_CODE", config)) {
+ this->AddPositionIndependentFlags(flags, lang, targetType);
}
-}
-
-bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
- const std::string& lang) const
-{
- std::string originalFlags =
- this->GlobalGenerator->GetSharedLibFlagsForLanguage(lang);
if (shared) {
- std::string flagsVar = cmStrCat("CMAKE_SHARED_LIBRARY_", lang, "_FLAGS");
- std::string const& flags = this->Makefile->GetSafeDefinition(flagsVar);
-
- if (flags != originalFlags) {
- switch (this->GetPolicyStatus(cmPolicies::CMP0018)) {
- case cmPolicies::WARN: {
- std::ostringstream e;
- e << "Variable " << flagsVar
- << " has been modified. CMake "
- "will ignore the POSITION_INDEPENDENT_CODE target property "
- "for "
- "shared libraries and will use the "
- << flagsVar
- << " variable "
- "instead. This may cause errors if the original content of "
- << flagsVar << " was removed.\n"
- << cmPolicies::GetPolicyWarning(cmPolicies::CMP0018);
-
- this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
- CM_FALLTHROUGH;
- }
- case cmPolicies::OLD:
- return true;
- case cmPolicies::NEW:
- return false;
- }
- }
+ this->AppendFeatureOptions(flags, lang, "DLL");
}
- return false;
}
void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
@@ -4327,15 +4270,12 @@
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 +4340,6 @@
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
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index ec4240f..3382675 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -16,8 +16,6 @@
#include <cm/optional>
-#include <cm3p/kwiml/int.h>
-
#include "cmCustomCommandTypes.h"
#include "cmGeneratorOptions.h"
#include "cmGeneratorTarget.h"
@@ -143,7 +141,7 @@
cmGeneratorTarget const* target,
const std::string& lang,
const std::string& config);
- void AddCMP0018Flags(std::string& flags, cmGeneratorTarget const* target,
+ void AddFeatureFlags(std::string& flags, cmGeneratorTarget const* target,
std::string const& lang, const std::string& config);
void AddVisibilityPresetFlags(std::string& flags,
cmGeneratorTarget const* target,
@@ -433,23 +431,6 @@
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 @@
bool EmitUniversalBinaryFlags;
- KWIML_INT_uint64_t BackwardsCompatibility;
- bool BackwardsCompatibilityFinal;
-
private:
/**
* See LinearGetSourceFileWithOutput for background information
@@ -651,9 +629,6 @@
OutputRole role, cmListFileBacktrace const& bt,
cmCommandOrigin origin);
- void AddSharedFlags(std::string& flags, const std::string& lang,
- bool shared);
- bool GetShouldUseOldFlags(bool shared, const std::string& lang) const;
void AddPositionIndependentFlags(std::string& flags, std::string const& l,
int targetType);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7c07319..2847340 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -994,6 +994,7 @@
vars.CMTargetName = target->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(target->GetType()).c_str();
+ vars.CMTargetLabels = target->GetTargetLabelsString().c_str();
std::string output;
const std::vector<std::string>& outputs = ccg.GetOutputs();
for (size_t i = 0; i < outputs.size(); ++i) {
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8450f75..7f41557 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -131,7 +131,7 @@
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)
@@ -195,39 +195,15 @@
return result;
}
-bool cmMakefile::CheckCMP0037(std::string const& targetName,
- cmStateEnums::TargetType targetType) const
+void cmMakefile::IssueInvalidTargetNameError(
+ std::string const& targetName) const
{
- MessageType messageType = MessageType::AUTHOR_WARNING;
- std::string e;
- bool issueMessage = false;
- switch (this->GetPolicyStatus(cmPolicies::CMP0037)) {
- case cmPolicies::WARN:
- if (targetType != cmStateEnums::INTERFACE_LIBRARY) {
- e = cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0037), '\n');
- issueMessage = true;
- }
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- issueMessage = true;
- messageType = MessageType::FATAL_ERROR;
- break;
- }
- if (issueMessage) {
- e +=
- cmStrCat("The target name \"", targetName,
- "\" is reserved or not valid for certain "
- "CMake features, such as generator expressions, and may result "
- "in undefined behavior.");
- this->IssueMessage(messageType, e);
-
- if (messageType == MessageType::FATAL_ERROR) {
- return false;
- }
- }
- return true;
+ this->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("The target name \"", targetName,
+ "\" is reserved or not valid for certain "
+ "CMake features, such as generator expressions, and may result "
+ "in undefined behavior."));
}
void cmMakefile::MaybeWarnCMP0074(std::string const& rootVar, cmValue rootDef,
@@ -601,9 +577,7 @@
private:
cmMakefile* Makefile;
bool NoPolicyScope;
- bool CheckCMP0011 = false;
bool ReportError = true;
- void EnforceCMP0011();
};
cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
@@ -621,48 +595,15 @@
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 +612,6 @@
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 +897,9 @@
"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();
}
}
@@ -1032,20 +928,6 @@
return this->ExportBuildFileGenerators;
}
-void cmMakefile::RemoveExportBuildFileGeneratorCMP0024(
- cmExportBuildFileGenerator* gen)
-{
- auto it =
- std::find_if(this->ExportBuildFileGenerators.begin(),
- this->ExportBuildFileGenerators.end(),
- [gen](std::unique_ptr<cmExportBuildFileGenerator> const& p) {
- return p.get() == gen;
- });
- if (it != this->ExportBuildFileGenerators.end()) {
- this->ExportBuildFileGenerators.erase(it);
- }
-}
-
void cmMakefile::AddExportBuildFileGenerator(
std::unique_ptr<cmExportBuildFileGenerator> gen)
{
@@ -1087,9 +969,6 @@
void cmMakefile::DoGenerate(cmLocalGenerator& lg)
{
- // do all the variable expansions here
- this->ExpandVariablesCMP0019();
-
// give all the commands a chance to do something
// after the file has been parsed before generation
for (auto& action : this->GeneratorActions) {
@@ -1187,38 +1066,20 @@
// Find the target to which to add the custom command.
auto ti = this->Targets.find(realTarget);
if (ti == this->Targets.end()) {
- MessageType messageType = MessageType::AUTHOR_WARNING;
- bool issueMessage = false;
std::string e;
- switch (this->GetPolicyStatus(cmPolicies::CMP0040)) {
- case cmPolicies::WARN:
- e = cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0040), '\n');
- issueMessage = true;
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- issueMessage = true;
- messageType = MessageType::FATAL_ERROR;
- break;
- }
-
- if (issueMessage) {
- if (cmTarget const* t = this->FindTargetToUse(target)) {
- if (t->IsImported()) {
- e += cmStrCat("TARGET '", target,
- "' is IMPORTED and does not build here.");
- } else {
- e += cmStrCat("TARGET '", target,
- "' was not created in this directory.");
- }
+ if (cmTarget const* t = this->FindTargetToUse(target)) {
+ if (t->IsImported()) {
+ e += cmStrCat("TARGET '", target,
+ "' is IMPORTED and does not build here.");
} else {
- e += cmStrCat("No TARGET '", target,
- "' has been created in this directory.");
+ e +=
+ cmStrCat("TARGET '", target, "' was not created in this directory.");
}
- this->GetCMakeInstance()->IssueMessage(messageType, e, lfbt);
+ } else {
+ e += cmStrCat("No TARGET '", target,
+ "' has been created in this directory.");
}
-
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e, lfbt);
return nullptr;
}
@@ -1319,72 +1180,6 @@
});
}
-void cmMakefile::AddCustomCommandOldStyle(
- const std::string& target, const std::vector<std::string>& outputs,
- const std::vector<std::string>& depends, const std::string& source,
- const cmCustomCommandLines& commandLines, const char* comment)
-{
- auto cc = cm::make_unique<cmCustomCommand>();
- cc->SetDepends(depends);
- cc->SetCommandLines(commandLines);
- cc->SetComment(comment);
-
- // Translate the old-style signature to one of the new-style
- // signatures.
- if (source == target) {
- // In the old-style signature if the source and target were the
- // same then it added a post-build rule to the target. Preserve
- // this behavior.
- this->AddCustomCommandToTarget(target, cmCustomCommandType::POST_BUILD,
- std::move(cc));
- return;
- }
-
- auto ti = this->Targets.find(target);
- cmTarget* t = ti != this->Targets.end() ? &ti->second : nullptr;
-
- auto addRuleFileToTarget = [=](cmSourceFile* sf) {
- // If the rule was added to the source (and not a .rule file),
- // then add the source to the target to make sure the rule is
- // included.
- if (!sf->GetPropertyAsBool("__CMAKE_RULE")) {
- if (t) {
- t->AddSource(sf->ResolveFullPath());
- } else {
- cmSystemTools::Error("Attempt to add a custom rule to a target "
- "that does not exist yet for target " +
- target);
- }
- }
- };
-
- // Each output must get its own copy of this rule.
- cmsys::RegularExpression sourceFiles(
- "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|mpp|ixx|cppm|ccm|cxxm|c\\+\\+m|cu|m|mm|"
- "rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|"
- "hm|hpp|hxx|in|txx|inl)$");
-
- // Choose whether to use a main dependency.
- if (sourceFiles.find(source)) {
- // The source looks like a real file. Use it as the main dependency.
- for (std::string const& output : outputs) {
- auto cc1 = cm::make_unique<cmCustomCommand>(*cc);
- cc1->SetOutputs(output);
- cc1->SetMainDependency(source);
- this->AddCustomCommandToOutput(std::move(cc1), addRuleFileToTarget);
- }
- } else {
- cc->AppendDepends({ source });
-
- // The source may not be a real file. Do not use a main dependency.
- for (std::string const& output : outputs) {
- auto cc1 = cm::make_unique<cmCustomCommand>(*cc);
- cc1->SetOutputs(output);
- this->AddCustomCommandToOutput(std::move(cc1), addRuleFileToTarget);
- }
- }
-}
-
void cmMakefile::AppendCustomCommandToOutput(
const std::string& output, const std::vector<std::string>& depends,
const cmImplicitDependsList& implicit_depends,
@@ -1538,27 +1333,6 @@
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;
@@ -1595,21 +1369,6 @@
this->SetProperty(prop, parent->GetProperty(prop));
}
- // compile definitions property and per-config versions
- cmPolicies::PolicyStatus polSt = this->GetPolicyStatus(cmPolicies::CMP0043);
- if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) {
- this->SetProperty("COMPILE_DEFINITIONS",
- parent->GetProperty("COMPILE_DEFINITIONS"));
- std::vector<std::string> configs =
- this->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
- for (std::string const& config : configs) {
- std::string defPropName =
- cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(config));
- cmValue prop = parent->GetProperty(defPropName);
- this->SetProperty(defPropName, prop);
- }
- }
-
// labels
this->SetProperty("LABELS", parent->GetProperty("LABELS"));
@@ -1845,7 +1604,7 @@
this->SetCheckCMP0000(true);
// Implicitly set the version for the user.
- cmPolicies::ApplyPolicyVersion(this, 2, 4, 0,
+ cmPolicies::ApplyPolicyVersion(this, 3, 0, 0,
cmPolicies::WarnCompat::Off);
}
}
@@ -1869,13 +1628,9 @@
"CMake is pretending there is a \"project(Project)\" command on "
"the first line.",
this->Backtrace);
- cmListFileFunction project{ "project",
- 0,
- 0,
- { { "Project", cmListFileArgument::Unquoted,
- 0 },
- { "__CMAKE_INJECTED_PROJECT_COMMAND__",
- cmListFileArgument::Unquoted, 0 } } };
+ cmListFileFunction project{
+ "project", 0, 0, { { "Project", cmListFileArgument::Unquoted, 0 } }
+ };
listFile.Functions.insert(listFile.Functions.begin(), project);
}
}
@@ -1912,29 +1667,10 @@
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
@@ -2423,94 +2159,6 @@
}
#endif
-static bool mightExpandVariablesCMP0019(const char* s)
-{
- return s && *s && strstr(s, "${") && strchr(s, '}');
-}
-
-void cmMakefile::ExpandVariablesCMP0019()
-{
- // Drop this ancient compatibility behavior with a policy.
- cmPolicies::PolicyStatus pol = this->GetPolicyStatus(cmPolicies::CMP0019);
- if (pol != cmPolicies::OLD && pol != cmPolicies::WARN) {
- return;
- }
-
- std::string e;
-
- cmValue includeDirs = this->GetProperty("INCLUDE_DIRECTORIES");
- if (includeDirs && mightExpandVariablesCMP0019(includeDirs->c_str())) {
- std::string dirs = *includeDirs;
- this->ExpandVariablesInString(dirs, true, true);
- if (pol == cmPolicies::WARN && dirs != *includeDirs) {
- e = cmStrCat("Evaluated directory INCLUDE_DIRECTORIES\n ", *includeDirs,
- "\nas\n ", dirs, '\n');
- }
- this->SetProperty("INCLUDE_DIRECTORIES", dirs);
- }
-
- // Also for each target's INCLUDE_DIRECTORIES property:
- for (auto& target : this->Targets) {
- cmTarget& t = target.second;
- if (t.GetType() == cmStateEnums::INTERFACE_LIBRARY ||
- t.GetType() == cmStateEnums::GLOBAL_TARGET) {
- continue;
- }
- includeDirs = t.GetProperty("INCLUDE_DIRECTORIES");
- if (includeDirs && mightExpandVariablesCMP0019(includeDirs->c_str())) {
- std::string dirs = *includeDirs;
- this->ExpandVariablesInString(dirs, true, true);
- if (pol == cmPolicies::WARN && dirs != *includeDirs) {
- e += cmStrCat("Evaluated target ", t.GetName(),
- " INCLUDE_DIRECTORIES\n ", *includeDirs, "\nas\n ",
- dirs, '\n');
- }
- t.SetProperty("INCLUDE_DIRECTORIES", dirs);
- }
- }
-
- if (cmValue linkDirsProp = this->GetProperty("LINK_DIRECTORIES")) {
- if (mightExpandVariablesCMP0019(linkDirsProp->c_str())) {
- std::string d = *linkDirsProp;
- const std::string orig = d;
- this->ExpandVariablesInString(d, true, true);
- if (pol == cmPolicies::WARN && d != orig) {
- e += cmStrCat("Evaluated link directories\n ", orig, "\nas\n ", d,
- '\n');
- }
- }
- }
-
- if (cmValue linkLibsProp = this->GetProperty("LINK_LIBRARIES")) {
- cmList linkLibs{ *linkLibsProp };
-
- for (auto l = linkLibs.begin(); l != linkLibs.end(); ++l) {
- std::string libName = *l;
- if (libName == "optimized"_s || libName == "debug"_s) {
- ++l;
- libName = *l;
- }
- if (mightExpandVariablesCMP0019(libName.c_str())) {
- const std::string orig = libName;
- this->ExpandVariablesInString(libName, true, true);
- if (pol == cmPolicies::WARN && libName != orig) {
- e += cmStrCat("Evaluated link library\n ", orig, "\nas\n ",
- libName, '\n');
- }
- }
- }
- }
-
- if (!e.empty()) {
- auto m = cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0019),
- "\n"
- "The following variable evaluations were encountered:\n",
- e);
- this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING, m,
- this->Backtrace);
- }
-}
-
bool cmMakefile::IsOn(const std::string& name) const
{
return this->GetDefinition(name).IsOn();
@@ -2916,30 +2564,7 @@
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 +2897,6 @@
// 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;
}
@@ -3883,16 +3505,6 @@
{
std::string result;
- // We search the module always in CMAKE_ROOT and in CMAKE_MODULE_PATH,
- // and then decide based on the policy setting which one to return.
- // See CMP0017 for more details.
- // The specific problem was that KDE 4.5.0 installs a
- // FindPackageHandleStandardArgs.cmake which doesn't have the new features
- // of FPHSA.cmake introduced in CMake 2.8.3 yet, and by setting
- // CMAKE_MODULE_PATH also e.g. FindZLIB.cmake from cmake included
- // FPHSA.cmake from kdelibs and not from CMake, and tried to use the
- // new features, which were not there in the version from kdelibs, and so
- // failed ("
std::string moduleInCMakeRoot;
std::string moduleInCMakeModulePath;
@@ -3930,37 +3542,22 @@
// Normally, prefer the files found in CMAKE_MODULE_PATH. Only when the file
// from which we are being called is located itself in CMAKE_ROOT, then
// prefer results from CMAKE_ROOT depending on the policy setting.
- system = false;
- result = moduleInCMakeModulePath;
- if (result.empty()) {
- system = true;
- result = moduleInCMakeRoot;
- }
-
if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty()) {
cmValue currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE");
std::string mods = cmStrCat(cmSystemTools::GetCMakeRoot(), "/Modules/");
if (currentFile && cmSystemTools::IsSubDirectory(*currentFile, mods)) {
- switch (this->GetPolicyStatus(cmPolicies::CMP0017)) {
- case cmPolicies::WARN: {
- auto e = cmStrCat(
- "File ", *currentFile, " includes ", moduleInCMakeModulePath,
- " (found via CMAKE_MODULE_PATH) which shadows ", moduleInCMakeRoot,
- ". This may cause errors later on .\n",
- cmPolicies::GetPolicyWarning(cmPolicies::CMP0017));
- this->IssueMessage(MessageType::AUTHOR_WARNING, e);
- CM_FALLTHROUGH;
- }
- case cmPolicies::OLD:
- system = false;
- result = moduleInCMakeModulePath;
- break;
- case cmPolicies::NEW:
- system = true;
- result = moduleInCMakeRoot;
- break;
- }
+ system = true;
+ result = moduleInCMakeRoot;
+ } else {
+ system = false;
+ result = moduleInCMakeModulePath;
}
+ } else if (!moduleInCMakeModulePath.empty()) {
+ system = false;
+ result = moduleInCMakeModulePath;
+ } else {
+ system = true;
+ result = moduleInCMakeRoot;
}
return result;
@@ -4411,17 +4008,6 @@
"\" 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 +4065,17 @@
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;
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 620917f..78a485d 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -235,12 +235,6 @@
void AddCustomCommandToOutput(
std::unique_ptr<cmCustomCommand> cc,
const CommandSourceCallback& callback = nullptr, bool replace = false);
- void AddCustomCommandOldStyle(const std::string& target,
- const std::vector<std::string>& outputs,
- const std::vector<std::string>& depends,
- const std::string& source,
- const cmCustomCommandLines& commandLines,
- const char* comment);
void AppendCustomCommandToOutput(
const std::string& output, const std::vector<std::string>& depends,
const cmImplicitDependsList& implicit_depends,
@@ -718,11 +712,6 @@
void RemoveVariablesInString(std::string& source, bool atOnly = false) const;
/**
- * Expand variables in the makefiles ivars such as link directories etc
- */
- void ExpandVariablesCMP0019();
-
- /**
* Replace variables and #cmakedefine lines in the given string.
* See cmConfigureFileCommand for details.
*/
@@ -999,8 +988,7 @@
/** Set whether or not to report a CMP0000 violation. */
void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
- bool CheckCMP0037(std::string const& targetName,
- cmStateEnums::TargetType targetType) const;
+ void IssueInvalidTargetNameError(std::string const& targetName) const;
cmBTStringRange GetIncludeDirectoriesEntries() const;
cmBTStringRange GetCompileOptionsEntries() const;
@@ -1039,7 +1027,6 @@
std::vector<std::unique_ptr<cmExportBuildFileGenerator>> const&
GetExportBuildFileGenerators() const;
- void RemoveExportBuildFileGeneratorCMP0024(cmExportBuildFileGenerator* gen);
void AddExportBuildFileGenerator(
std::unique_ptr<cmExportBuildFileGenerator> gen);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e24f2b7..3dacc62 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -537,6 +537,8 @@
vars.CMTargetName = this->GeneratorTarget->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GeneratorTarget->GetType()).c_str();
+ vars.CMTargetLabels =
+ this->GeneratorTarget->GetTargetLabelsString().c_str();
vars.Language = linkLanguage.c_str();
vars.Linker = linker.c_str();
vars.AIXExports = aixExports.c_str();
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 746ee50..1b2a37e 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -781,6 +781,8 @@
vars.CMTargetName = this->GeneratorTarget->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GeneratorTarget->GetType()).c_str();
+ vars.CMTargetLabels =
+ this->GeneratorTarget->GetTargetLabelsString().c_str();
vars.Language = linkLanguage.c_str();
vars.Linker = linker.c_str();
vars.AIXExports = aixExports.c_str();
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 8098d70..5f4cddb 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -931,6 +931,7 @@
vars.CMTargetName = this->GeneratorTarget->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GeneratorTarget->GetType()).c_str();
+ vars.CMTargetLabels = this->GeneratorTarget->GetTargetLabelsString().c_str();
vars.Language = lang.c_str();
vars.Target = targetOutPathReal.c_str();
vars.TargetPDB = targetOutPathPDB.c_str();
@@ -1694,7 +1695,7 @@
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType()).c_str();
-
+ vars.CMTargetLabels = this->GeneratorTarget->GetTargetLabelsString().c_str();
vars.Language = "CUDA";
vars.Object = output.c_str();
vars.Fatbinary = fatbinaryOutput.c_str();
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 8b34045..cde90c2 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -293,6 +293,8 @@
vars.CMTargetType =
cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
.c_str();
+ vars.CMTargetLabels =
+ this->GetGeneratorTarget()->GetTargetLabelsString().c_str();
vars.Language = "CUDA";
std::string linker =
@@ -400,6 +402,8 @@
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType()).c_str();
+ vars.CMTargetLabels =
+ this->GetGeneratorTarget()->GetTargetLabelsString().c_str();
vars.Language = "CUDA";
vars.Object = "$out";
@@ -451,6 +455,8 @@
cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType = cmState::GetTargetTypeName(targetType).c_str();
+ vars.CMTargetLabels =
+ this->GetGeneratorTarget()->GetTargetLabelsString().c_str();
std::string linker = this->GetGeneratorTarget()->GetLinkerTool(config);
vars.Linker = linker.c_str();
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d2fb5b5..319106f 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -623,6 +623,7 @@
cmRulePlaceholderExpander::RuleVariables scanVars;
scanVars.CMTargetName = vars.CMTargetName;
scanVars.CMTargetType = vars.CMTargetType;
+ scanVars.CMTargetLabels = vars.CMTargetLabels;
scanVars.Language = vars.Language;
scanVars.Object = "$OBJ_FILE";
scanVars.PreprocessedSource = ppFileName.c_str();
@@ -681,6 +682,8 @@
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType()).c_str();
+ vars.CMTargetLabels =
+ this->GetGeneratorTarget()->GetTargetLabelsString().c_str();
vars.Language = lang.c_str();
vars.Source = "$in";
vars.Object = "$out";
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
deleted file mode 100644
index aa3155a..0000000
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ /dev/null
@@ -1,514 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmOutputRequiredFilesCommand.h"
-
-#include <cstdio>
-#include <map>
-#include <set>
-#include <unordered_map>
-#include <utility>
-
-#include <cm/memory>
-
-#include "cmsys/FStream.hxx"
-#include "cmsys/RegularExpression.hxx"
-
-#include "cmExecutionStatus.h"
-#include "cmGeneratorExpression.h"
-#include "cmList.h"
-#include "cmMakefile.h"
-#include "cmSourceFile.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-#include "cmTarget.h"
-#include "cmValue.h"
-
-namespace {
-/** \class cmDependInformation
- * \brief Store dependency information for a single source file.
- *
- * This structure stores the depend information for a single source file.
- */
-class cmDependInformation
-{
-public:
- /**
- * Construct with dependency generation marked not done; instance
- * not placed in cmMakefile's list.
- */
- cmDependInformation() = default;
-
- /**
- * The set of files on which this one depends.
- */
- using DependencySetType = std::set<cmDependInformation*>;
- DependencySetType DependencySet;
-
- /**
- * This flag indicates whether dependency checking has been
- * performed for this file.
- */
- bool DependDone = false;
-
- /**
- * If this object corresponds to a cmSourceFile instance, this points
- * to it.
- */
- const cmSourceFile* SourceFile = nullptr;
-
- /**
- * Full path to this file.
- */
- std::string FullPath;
-
- /**
- * Full path not including file name.
- */
- std::string PathOnly;
-
- /**
- * Name used to #include this file.
- */
- std::string IncludeName;
-
- /**
- * This method adds the dependencies of another file to this one.
- */
- void AddDependencies(cmDependInformation* info)
- {
- if (this != info) {
- this->DependencySet.insert(info);
- }
- }
-};
-
-class cmLBDepend
-{
-public:
- /**
- * Construct the object with verbose turned off.
- */
- cmLBDepend()
- {
- this->Verbose = false;
- this->IncludeFileRegularExpression.compile("^.*$");
- this->ComplainFileRegularExpression.compile("^$");
- }
-
- /**
- * Destructor.
- */
- ~cmLBDepend() = default;
-
- cmLBDepend(const cmLBDepend&) = delete;
- cmLBDepend& operator=(const cmLBDepend&) = delete;
-
- /**
- * Set the makefile that is used as a source of classes.
- */
- void SetMakefile(cmMakefile* makefile)
- {
- this->Makefile = makefile;
-
- // Now extract the include file regular expression from the makefile.
- this->IncludeFileRegularExpression.compile(
- this->Makefile->GetIncludeRegularExpression());
- this->ComplainFileRegularExpression.compile(
- this->Makefile->GetComplainRegularExpression());
-
- // Now extract any include paths from the targets
- std::set<std::string> uniqueIncludes;
- std::vector<std::string> orderedAndUniqueIncludes;
- for (auto const& target : this->Makefile->GetTargets()) {
- cmValue incDirProp = target.second.GetProperty("INCLUDE_DIRECTORIES");
- if (!incDirProp) {
- continue;
- }
-
- std::string incDirs = cmGeneratorExpression::Preprocess(
- *incDirProp, cmGeneratorExpression::StripAllGeneratorExpressions);
-
- cmList includes{ incDirs };
-
- for (auto& path : includes) {
- this->Makefile->ExpandVariablesInString(path);
- if (uniqueIncludes.insert(path).second) {
- orderedAndUniqueIncludes.push_back(path);
- }
- }
- }
-
- for (std::string const& inc : orderedAndUniqueIncludes) {
- this->AddSearchPath(inc);
- }
- }
-
- /**
- * Add a directory to the search path for include files.
- */
- void AddSearchPath(const std::string& path)
- {
- this->IncludeDirectories.push_back(path);
- }
-
- /**
- * Generate dependencies for the file given. Returns a pointer to
- * the cmDependInformation object for the file.
- */
- const cmDependInformation* FindDependencies(const std::string& file)
- {
- cmDependInformation* info = this->GetDependInformation(file, "");
- this->GenerateDependInformation(info);
- return info;
- }
-
-protected:
- /**
- * Compute the depend information for this class.
- */
-
- void DependWalk(cmDependInformation* info)
- {
- cmsys::ifstream fin(info->FullPath.c_str());
- if (!fin) {
- cmSystemTools::Error("error can not open " + info->FullPath);
- return;
- }
-
- std::string line;
- while (cmSystemTools::GetLineFromStream(fin, line)) {
- if (cmHasLiteralPrefix(line, "#include")) {
- // if it is an include line then create a string class
- size_t qstart = line.find('\"', 8);
- size_t qend;
- // if a quote is not found look for a <
- if (qstart == std::string::npos) {
- qstart = line.find('<', 8);
- // if a < is not found then move on
- if (qstart == std::string::npos) {
- cmSystemTools::Error("unknown include directive " + line);
- continue;
- }
- qend = line.find('>', qstart + 1);
- } else {
- qend = line.find('\"', qstart + 1);
- }
- // extract the file being included
- std::string includeFile = line.substr(qstart + 1, qend - qstart - 1);
- // see if the include matches the regular expression
- if (!this->IncludeFileRegularExpression.find(includeFile)) {
- if (this->Verbose) {
- std::string message =
- cmStrCat("Skipping ", includeFile, " for file ", info->FullPath);
- cmSystemTools::Error(message);
- }
- continue;
- }
-
- // Add this file and all its dependencies.
- this->AddDependency(info, includeFile);
- /// add the cxx file if it exists
- std::string cxxFile = includeFile;
- std::string::size_type pos = cxxFile.rfind('.');
- if (pos != std::string::npos) {
- std::string root = cxxFile.substr(0, pos);
- cxxFile = root + ".cxx";
- bool found = false;
- // try jumping to .cxx .cpp and .c in order
- if (cmSystemTools::FileExists(cxxFile)) {
- found = true;
- }
- for (std::string const& path : this->IncludeDirectories) {
- if (cmSystemTools::FileExists(cmStrCat(path, "/", cxxFile))) {
- found = true;
- }
- }
- if (!found) {
- cxxFile = root + ".cpp";
- if (cmSystemTools::FileExists(cxxFile)) {
- found = true;
- }
- for (std::string const& path : this->IncludeDirectories) {
- if (cmSystemTools::FileExists(cmStrCat(path, "/", cxxFile))) {
- found = true;
- }
- }
- }
- if (!found) {
- cxxFile = root + ".c";
- if (cmSystemTools::FileExists(cxxFile)) {
- found = true;
- }
- for (std::string const& path : this->IncludeDirectories) {
- if (cmSystemTools::FileExists(cmStrCat(path, "/", cxxFile))) {
- found = true;
- }
- }
- }
- if (!found) {
- cxxFile = root + ".txx";
- if (cmSystemTools::FileExists(cxxFile)) {
- found = true;
- }
- for (std::string const& path : this->IncludeDirectories) {
- if (cmSystemTools::FileExists(cmStrCat(path, "/", cxxFile))) {
- found = true;
- }
- }
- }
- if (found) {
- this->AddDependency(info, cxxFile);
- }
- }
- }
- }
- }
-
- /**
- * Add a dependency. Possibly walk it for more dependencies.
- */
- void AddDependency(cmDependInformation* info, const std::string& file)
- {
- cmDependInformation* dependInfo =
- this->GetDependInformation(file, info->PathOnly);
- this->GenerateDependInformation(dependInfo);
- info->AddDependencies(dependInfo);
- }
-
- /**
- * Fill in the given object with dependency information. If the
- * information is already complete, nothing is done.
- */
- void GenerateDependInformation(cmDependInformation* info)
- {
- // If dependencies are already done, stop now.
- if (info->DependDone) {
- return;
- }
- // Make sure we don't visit the same file more than once.
- info->DependDone = true;
-
- const std::string& path = info->FullPath;
- if (path.empty()) {
- cmSystemTools::Error(
- "Attempt to find dependencies for file without path!");
- return;
- }
-
- bool found = false;
-
- // If the file exists, use it to find dependency information.
- if (cmSystemTools::FileExists(path, true)) {
- // Use the real file to find its dependencies.
- this->DependWalk(info);
- found = true;
- }
-
- // See if the cmSourceFile for it has any files specified as
- // dependency hints.
- if (info->SourceFile) {
-
- // Get the cmSourceFile corresponding to this.
- const cmSourceFile& cFile = *(info->SourceFile);
- // See if there are any hints for finding dependencies for the missing
- // file.
- if (!cFile.GetDepends().empty()) {
- // Dependency hints have been given. Use them to begin the
- // recursion.
- for (std::string const& file : cFile.GetDepends()) {
- this->AddDependency(info, file);
- }
-
- // Found dependency information. We are done.
- found = true;
- }
- }
-
- if (!found) {
- // Try to find the file amongst the sources
- cmSourceFile* srcFile = this->Makefile->GetSource(
- cmSystemTools::GetFilenameWithoutExtension(path));
- if (srcFile) {
- if (srcFile->ResolveFullPath() == path) {
- found = true;
- } else {
- // try to guess which include path to use
- for (std::string incpath : this->IncludeDirectories) {
- if (!incpath.empty() && incpath.back() != '/') {
- incpath += "/";
- }
- incpath += path;
- if (srcFile->ResolveFullPath() == incpath) {
- // set the path to the guessed path
- info->FullPath = incpath;
- found = true;
- }
- }
- }
- }
- }
-
- if (!found) {
- // Couldn't find any dependency information.
- if (this->ComplainFileRegularExpression.find(info->IncludeName)) {
- cmSystemTools::Error("error cannot find dependencies for " + path);
- } else {
- // Destroy the name of the file so that it won't be output as a
- // dependency.
- info->FullPath.clear();
- }
- }
- }
-
- /**
- * Get an instance of cmDependInformation corresponding to the given file
- * name.
- */
- cmDependInformation* GetDependInformation(const std::string& file,
- const std::string& extraPath)
- {
- // Get the full path for the file so that lookup is unambiguous.
- std::string fullPath = this->FullPath(file, extraPath);
-
- // Try to find the file's instance of cmDependInformation.
- auto result = this->DependInformationMap.find(fullPath);
- if (result != this->DependInformationMap.end()) {
- // Found an instance, return it.
- return result->second.get();
- }
- // Didn't find an instance. Create a new one and save it.
- auto info = cm::make_unique<cmDependInformation>();
- auto* ptr = info.get();
- info->FullPath = fullPath;
- info->PathOnly = cmSystemTools::GetFilenamePath(fullPath);
- info->IncludeName = file;
- this->DependInformationMap[fullPath] = std::move(info);
- return ptr;
- }
-
- /**
- * Find the full path name for the given file name.
- * This uses the include directories.
- * TODO: Cache path conversions to reduce FileExists calls.
- */
- std::string FullPath(const std::string& fname, const std::string& extraPath)
- {
- auto m = this->DirectoryToFileToPathMap.find(extraPath);
-
- if (m != this->DirectoryToFileToPathMap.end()) {
- FileToPathMapType& map = m->second;
- auto p = map.find(fname);
- if (p != map.end()) {
- return p->second;
- }
- }
-
- if (cmSystemTools::FileExists(fname, true)) {
- std::string fp = cmSystemTools::CollapseFullPath(fname);
- this->DirectoryToFileToPathMap[extraPath][fname] = fp;
- return fp;
- }
-
- for (std::string path : this->IncludeDirectories) {
- if (!path.empty() && path.back() != '/') {
- path += "/";
- }
- path += fname;
- if (cmSystemTools::FileExists(path, true)) {
- std::string fp = cmSystemTools::CollapseFullPath(path);
- this->DirectoryToFileToPathMap[extraPath][fname] = fp;
- return fp;
- }
- }
-
- if (!extraPath.empty()) {
- std::string path = extraPath;
- if (!path.empty() && path.back() != '/') {
- path = path + "/";
- }
- path = path + fname;
- if (cmSystemTools::FileExists(path, true)) {
- std::string fp = cmSystemTools::CollapseFullPath(path);
- this->DirectoryToFileToPathMap[extraPath][fname] = fp;
- return fp;
- }
- }
-
- // Couldn't find the file.
- return fname;
- }
-
- cmMakefile* Makefile;
- bool Verbose;
- cmsys::RegularExpression IncludeFileRegularExpression;
- cmsys::RegularExpression ComplainFileRegularExpression;
- std::vector<std::string> IncludeDirectories;
- using FileToPathMapType = std::map<std::string, std::string>;
- using DirectoryToFileToPathMapType =
- std::map<std::string, FileToPathMapType>;
- using DependInformationMapType =
- std::map<std::string, std::unique_ptr<cmDependInformation>>;
- DependInformationMapType DependInformationMap;
- DirectoryToFileToPathMapType DirectoryToFileToPathMap;
-};
-
-void ListDependencies(cmDependInformation const* info, FILE* fout,
- std::set<cmDependInformation const*>* visited);
-}
-
-// cmOutputRequiredFilesCommand
-bool cmOutputRequiredFilesCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status)
-{
- if (args.size() != 2) {
- status.SetError("called with incorrect number of arguments");
- return false;
- }
-
- // store the arg for final pass
- const std::string& file = args[0];
- const std::string& outputFile = args[1];
-
- // compute the list of files
- cmLBDepend md;
- md.SetMakefile(&status.GetMakefile());
- md.AddSearchPath(status.GetMakefile().GetCurrentSourceDirectory());
- // find the depends for a file
- const cmDependInformation* info = md.FindDependencies(file);
- if (info) {
- // write them out
- FILE* fout = cmsys::SystemTools::Fopen(outputFile, "w");
- if (!fout) {
- status.SetError(cmStrCat("Can not open output file: ", outputFile));
- return false;
- }
- std::set<cmDependInformation const*> visited;
- ListDependencies(info, fout, &visited);
- fclose(fout);
- }
-
- return true;
-}
-
-namespace {
-void ListDependencies(cmDependInformation const* info, FILE* fout,
- std::set<cmDependInformation const*>* visited)
-{
- // add info to the visited set
- visited->insert(info);
- // now recurse with info's dependencies
- for (cmDependInformation* d : info->DependencySet) {
- if (visited->find(d) == visited->end()) {
- if (!info->FullPath.empty()) {
- std::string tmp = d->FullPath;
- std::string::size_type pos = tmp.rfind('.');
- if (pos != std::string::npos && (tmp.substr(pos) != ".h")) {
- tmp = tmp.substr(0, pos);
- fprintf(fout, "%s\n", d->FullPath.c_str());
- }
- }
- ListDependencies(d, fout, visited);
- }
- }
-}
-}
diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h
deleted file mode 100644
index 9daba8f..0000000
--- a/Source/cmOutputRequiredFilesCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmOutputRequiredFilesCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index fa64029..8b944b2 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -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,23 @@
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 < 3) {
+ 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 = 3;
+ minorVer = 0;
+ patchVer = 0;
+ } else {
+ mf->IssueMessage(MessageType::FATAL_ERROR,
+ "Compatibility with CMake < 3.0 has been removed "
+ "from CMake.\n" ADVICE_UPDATE_VERSION_ARGUMENT);
+ cmSystemTools::SetFatalErrorOccurred();
+ return false;
+ }
+ } else if (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 +330,6 @@
!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)) {
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 67d3d11..a7ae22e 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -15,143 +15,141 @@
#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) \
+ 1, NEW) \
SELECT(POLICY, CMP0016, \
"target_link_libraries() reports error if its only argument " \
"is not a target.", \
- 2, 8, 3, WARN) \
+ 2, 8, 3, NEW) \
SELECT(POLICY, CMP0017, \
"Prefer files from the CMake module directory when including from " \
"there.", \
- 2, 8, 4, WARN) \
+ 2, 8, 4, NEW) \
SELECT(POLICY, CMP0018, \
- "Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.", 2, 8, 9, WARN) \
+ "Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.", 2, 8, 9, NEW) \
SELECT(POLICY, CMP0019, \
"Do not re-expand variables in include and link information.", 2, 8, \
- 11, WARN) \
+ 11, NEW) \
SELECT(POLICY, CMP0020, \
"Automatically link Qt executables to qtmain target on Windows.", 2, \
- 8, 11, WARN) \
+ 8, 11, NEW) \
SELECT( \
POLICY, CMP0021, \
"Fatal error on relative paths in INCLUDE_DIRECTORIES target property.", \
- 2, 8, 12, WARN) \
+ 2, 8, 12, NEW) \
SELECT(POLICY, CMP0022, \
"INTERFACE_LINK_LIBRARIES defines the link interface.", 2, 8, 12, \
- WARN) \
+ NEW) \
SELECT( \
POLICY, CMP0023, \
"Plain and keyword target_link_libraries signatures cannot be mixed.", 2, \
- 8, 12, WARN) \
- SELECT(POLICY, CMP0024, "Disallow include export result.", 3, 0, 0, WARN) \
+ 8, 12, NEW) \
+ SELECT(POLICY, CMP0024, "Disallow include export result.", 3, 0, 0, NEW) \
SELECT(POLICY, CMP0025, "Compiler id for Apple Clang is now AppleClang.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0026, "Disallow use of the LOCATION target property.", 3, \
- 0, 0, WARN) \
+ 0, 0, NEW) \
SELECT(POLICY, CMP0027, \
"Conditionally linked imported targets with missing include " \
"directories.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0028, \
"Double colon in target name means ALIAS or IMPORTED target.", 3, 0, \
- 0, WARN) \
+ 0, NEW) \
SELECT(POLICY, CMP0029, "The subdir_depends command should not be called.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0030, \
- "The use_mangled_mesa command should not be called.", 3, 0, 0, WARN) \
+ "The use_mangled_mesa command should not be called.", 3, 0, 0, NEW) \
SELECT(POLICY, CMP0031, "The load_command command should not be called.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0032, \
"The output_required_files command should not be called.", 3, 0, 0, \
- WARN) \
+ NEW) \
SELECT(POLICY, CMP0033, \
"The export_library_dependencies command should not be called.", 3, \
- 0, 0, WARN) \
+ 0, 0, NEW) \
SELECT(POLICY, CMP0034, "The utility_source command should not be called.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0035, \
- "The variable_requires command should not be called.", 3, 0, 0, \
- WARN) \
+ "The variable_requires command should not be called.", 3, 0, 0, NEW) \
SELECT(POLICY, CMP0036, "The build_name command should not be called.", 3, \
- 0, 0, WARN) \
+ 0, 0, NEW) \
SELECT(POLICY, CMP0037, \
"Target names should not be reserved and should match a validity " \
"pattern.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0038, "Targets may not link directly to themselves.", 3, \
- 0, 0, WARN) \
+ 0, 0, NEW) \
SELECT(POLICY, CMP0039, "Utility targets may not have link dependencies.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0040, \
"The target in the TARGET signature of add_custom_command() must " \
"exist and must be defined in the current directory.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0041, \
"Error on relative include with generator expression.", 3, 0, 0, \
- WARN) \
+ NEW) \
SELECT(POLICY, CMP0042, "MACOSX_RPATH is enabled by default.", 3, 0, 0, \
- WARN) \
+ NEW) \
SELECT(POLICY, CMP0043, "Ignore COMPILE_DEFINITIONS_<Config> properties.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0044, \
"Case sensitive <LANG>_COMPILER_ID generator expressions.", 3, 0, 0, \
- WARN) \
+ NEW) \
SELECT(POLICY, CMP0045, \
"Error on non-existent target in get_target_property.", 3, 0, 0, \
- WARN) \
+ NEW) \
SELECT(POLICY, CMP0046, \
"Error on non-existent dependency in add_dependencies.", 3, 0, 0, \
- WARN) \
+ NEW) \
SELECT(POLICY, CMP0047, "Use QCC compiler id for the qcc drivers on QNX.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0048, "project() command manages VERSION variables.", 3, \
- 0, 0, WARN) \
+ 0, 0, NEW) \
SELECT(POLICY, CMP0049, \
- "Do not expand variables in target source entries.", 3, 0, 0, WARN) \
+ "Do not expand variables in target source entries.", 3, 0, 0, NEW) \
SELECT(POLICY, CMP0050, "Disallow add_custom_command SOURCE signatures.", \
- 3, 0, 0, WARN) \
+ 3, 0, 0, NEW) \
SELECT(POLICY, CMP0051, "List TARGET_OBJECTS in SOURCES target property.", \
3, 1, 0, WARN) \
SELECT(POLICY, CMP0052, \
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 5d854cd..0aa7bbd 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -107,7 +107,6 @@
bool haveLanguages = false;
bool haveDescription = false;
bool haveHomepage = false;
- bool injectedProjectCommand = false;
std::string version;
std::string description;
std::string homepage;
@@ -198,8 +197,6 @@
"by a value that expanded to nothing.");
resetReporter();
};
- } else if (i == 1 && args[i] == "__CMAKE_INJECTED_PROJECT_COMMAND__") {
- injectedProjectCommand = true;
} else if (doing == DoingVersion) {
doing = DoingLanguages;
version = args[i];
@@ -234,17 +231,7 @@
languages.emplace_back("NONE");
}
- cmPolicies::PolicyStatus const cmp0048 =
- mf.GetPolicyStatus(cmPolicies::CMP0048);
if (haveVersion) {
- // Set project VERSION variables to given values
- if (cmp0048 == cmPolicies::OLD || cmp0048 == cmPolicies::WARN) {
- mf.IssueMessage(MessageType::FATAL_ERROR,
- "VERSION not allowed unless CMP0048 is set to NEW");
- cmSystemTools::SetFatalErrorOccurred();
- return true;
- }
-
cmsys::RegularExpression vx(
R"(^([0-9]+(\.[0-9]+(\.[0-9]+(\.[0-9]+)?)?)?)?$)");
if (!vx.find(version)) {
@@ -315,7 +302,7 @@
version_components[2]);
TopLevelCMakeVarCondSet(mf, "CMAKE_PROJECT_VERSION_TWEAK",
version_components[3]);
- } else if (cmp0048 != cmPolicies::OLD) {
+ } else {
// Set project VERSION variables to empty
std::vector<std::string> vv = { "PROJECT_VERSION",
"PROJECT_VERSION_MAJOR",
@@ -334,26 +321,12 @@
vv.emplace_back("CMAKE_PROJECT_VERSION_PATCH");
vv.emplace_back("CMAKE_PROJECT_VERSION_TWEAK");
}
- std::string vw;
for (std::string const& i : vv) {
cmValue v = mf.GetDefinition(i);
if (cmNonempty(v)) {
- if (cmp0048 == cmPolicies::WARN) {
- if (!injectedProjectCommand) {
- vw += "\n ";
- vw += i;
- }
- } else {
- mf.AddDefinition(i, "");
- }
+ mf.AddDefinition(i, "");
}
}
- if (!vw.empty()) {
- mf.IssueMessage(
- MessageType::AUTHOR_WARNING,
- cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0048),
- "\nThe following variable(s) would be set to empty:", vw));
- }
}
mf.AddDefinition("PROJECT_DESCRIPTION", description);
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx
index ce41c8a..4420e38 100644
--- a/Source/cmRulePlaceholderExpander.cxx
+++ b/Source/cmRulePlaceholderExpander.cxx
@@ -261,6 +261,13 @@
return this->ReplaceValues->CMTargetType;
}
}
+ if (variable == "TARGET_LABELS") {
+ if (this->ReplaceValues->CMTargetLabels) {
+ return this->ReplaceValues->CMTargetLabels;
+ }
+ return "";
+ }
+
if (this->ReplaceValues->Output) {
if (variable == "OUTPUT") {
return this->ReplaceValues->Output;
diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h
index d2a88e0..9b131fb 100644
--- a/Source/cmRulePlaceholderExpander.h
+++ b/Source/cmRulePlaceholderExpander.h
@@ -32,6 +32,7 @@
{
const char* CMTargetName = nullptr;
const char* CMTargetType = nullptr;
+ const char* CMTargetLabels = nullptr;
const char* TargetPDB = nullptr;
const char* TargetCompilePDB = nullptr;
const char* TargetVersionMajor = nullptr;
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 31dba0e..85adfe0 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -472,6 +472,18 @@
});
}
+void cmState::AddRemovedCommand(std::string const& name,
+ std::string const& message)
+{
+ this->AddBuiltinCommand(name,
+ [message](std::vector<cmListFileArgument> const&,
+ cmExecutionStatus& status) -> bool {
+ status.GetMakefile().IssueMessage(
+ MessageType::FATAL_ERROR, message);
+ return true;
+ });
+}
+
void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
{
this->AddBuiltinCommand(
diff --git a/Source/cmState.h b/Source/cmState.h
index 6239511..ac0175e 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -183,6 +183,7 @@
void AddDisallowedCommand(std::string const& name, BuiltinCommand command,
cmPolicies::PolicyID policy, const char* message,
const char* additionalWarning = nullptr);
+ void AddRemovedCommand(std::string const& name, std::string const& message);
void AddUnexpectedCommand(std::string const& name, const char* error);
void AddUnexpectedFlowControlCommand(std::string const& name,
const char* error);
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 0e48ab2..91b827c 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -200,11 +200,6 @@
return status;
}
-bool cmStateSnapshot::HasDefinedPolicyCMP0011()
-{
- return !this->Position->Policies->IsEmpty();
-}
-
cmValue cmStateSnapshot::GetDefinition(std::string const& name) const
{
assert(this->Position->Vars.IsValid());
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index 1796d76..a8cafcd 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -46,7 +46,6 @@
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();
diff --git a/Source/cmSubdirDependsCommand.cxx b/Source/cmSubdirDependsCommand.cxx
deleted file mode 100644
index 496c60d..0000000
--- a/Source/cmSubdirDependsCommand.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmSubdirDependsCommand.h"
-
-class cmExecutionStatus;
-
-bool cmSubdirDependsCommand(std::vector<std::string> const&,
- cmExecutionStatus&)
-{
- return true;
-}
diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h
deleted file mode 100644
index 133d702..0000000
--- a/Source/cmSubdirDependsCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmSubdirDependsCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a0088e1..c754628 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -23,7 +23,6 @@
#include "cmFileSet.h"
#include "cmFindPackageStack.h"
#include "cmGeneratorExpression.h"
-#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmList.h"
#include "cmListFileCache.h"
@@ -46,41 +45,12 @@
#include "cmake.h"
template <>
-const std::string& cmTargetPropertyComputer::ComputeLocationForBuild<cmTarget>(
- cmTarget const* tgt)
-{
- static std::string loc;
- if (tgt->IsImported()) {
- loc = tgt->ImportedGetFullPath("", cmStateEnums::RuntimeBinaryArtifact);
- return loc;
- }
-
- cmGlobalGenerator* gg = tgt->GetGlobalGenerator();
- if (!gg->GetConfigureDoneCMP0026()) {
- gg->CreateGenerationObjects();
- }
- cmGeneratorTarget* gt = gg->FindGeneratorTarget(tgt->GetName());
- loc = gt->GetLocationForBuild();
- return loc;
-}
-
-template <>
-const std::string& cmTargetPropertyComputer::ComputeLocation<cmTarget>(
+const std::string& cmTargetPropertyComputer::ImportedLocation<cmTarget>(
cmTarget const* tgt, const std::string& config)
{
static std::string loc;
- if (tgt->IsImported()) {
- loc =
- tgt->ImportedGetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
- return loc;
- }
-
- cmGlobalGenerator* gg = tgt->GetGlobalGenerator();
- if (!gg->GetConfigureDoneCMP0026()) {
- gg->CreateGenerationObjects();
- }
- cmGeneratorTarget* gt = gg->FindGeneratorTarget(tgt->GetName());
- loc = gt->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
+ assert(tgt->IsImported());
+ loc = tgt->ImportedGetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
return loc;
}
@@ -712,8 +682,6 @@
bool CheckImportedLibName(std::string const& prop,
std::string const& value) const;
- std::string ProcessSourceItemCMP0049(const std::string& s) const;
-
template <typename ValueType>
void AddDirectoryToFileSet(cmTarget* self, std::string const& fileSetName,
ValueType value, cm::string_view fileSetType,
@@ -999,14 +967,6 @@
// Record current policies for later use.
this->impl->Makefile->RecordPolicies(this->impl->PolicyMap);
- if (this->impl->TargetType == cmStateEnums::INTERFACE_LIBRARY) {
- // This policy is checked in a few conditions. The properties relevant
- // to the policy are always ignored for cmStateEnums::INTERFACE_LIBRARY
- // targets,
- // so ensure that the conditions don't lead to nonsense.
- this->impl->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
- }
-
std::set<TargetProperty::InitCondition> metConditions;
metConditions.insert(TargetProperty::InitCondition::Always);
if (this->CanCompileSources()) {
@@ -1406,14 +1366,8 @@
void cmTarget::AddSources(std::vector<std::string> const& srcs)
{
std::vector<std::string> srcFiles;
- for (auto filename : srcs) {
+ for (std::string const& filename : srcs) {
if (!cmGeneratorExpression::StartsWithGeneratorExpression(filename)) {
- if (!filename.empty()) {
- filename = this->impl->ProcessSourceItemCMP0049(filename);
- if (filename.empty()) {
- return;
- }
- }
this->impl->Makefile->GetOrCreateSource(filename);
}
srcFiles.emplace_back(filename);
@@ -1421,47 +1375,6 @@
this->AddTracedSources(srcFiles);
}
-std::string cmTargetInternals::ProcessSourceItemCMP0049(
- const std::string& s) const
-{
- std::string src = s;
-
- // For backwards compatibility replace variables in source names.
- // This should eventually be removed.
- this->Makefile->ExpandVariablesInString(src);
- if (src != s) {
- std::ostringstream e;
- bool noMessage = false;
- MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0049)) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0049) << "\n";
- break;
- case cmPolicies::OLD:
- noMessage = true;
- break;
- case cmPolicies::NEW:
- messageType = MessageType::FATAL_ERROR;
- }
- if (!noMessage) {
- e << "Legacy variable expansion in source file \"" << s
- << "\" expanded to \"" << src << "\" in target \"" << this->Name
- << "\". This behavior will be removed in a "
- "future version of CMake.";
- this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == MessageType::FATAL_ERROR) {
- return "";
- }
- }
- }
- return src;
-}
-
-std::string cmTarget::GetSourceCMP0049(const std::string& s)
-{
- return this->impl->ProcessSourceItemCMP0049(s);
-}
-
struct CreateLocation
{
cmMakefile const* Makefile;
@@ -2552,8 +2465,7 @@
}
void cmTarget::FinalizeTargetConfiguration(
- const cmBTStringRange& noConfigCompileDefinitions,
- cm::optional<std::map<std::string, cmValue>>& perConfigCompileDefinitions)
+ const cmBTStringRange& compileDefinitions)
{
if (this->GetType() == cmStateEnums::GLOBAL_TARGET) {
return;
@@ -2574,35 +2486,9 @@
return;
}
- for (auto const& def : noConfigCompileDefinitions) {
+ for (auto const& def : compileDefinitions) {
this->InsertCompileDefinition(def);
}
-
- auto* mf = this->GetMakefile();
- cmPolicies::PolicyStatus polSt = mf->GetPolicyStatus(cmPolicies::CMP0043);
- if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) {
- if (perConfigCompileDefinitions) {
- for (auto const& it : *perConfigCompileDefinitions) {
- if (cmValue val = it.second) {
- this->AppendProperty(it.first, *val);
- }
- }
- } else {
- perConfigCompileDefinitions.emplace();
- std::vector<std::string> configs =
- mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
-
- for (std::string const& c : configs) {
- std::string defPropName =
- cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(c));
- cmValue val = mf->GetProperty(defPropName);
- (*perConfigCompileDefinitions)[defPropName] = val;
- if (val) {
- this->AppendProperty(defPropName, *val);
- }
- }
- }
- }
}
void cmTarget::InsertInclude(BT<std::string> const& entry, bool before)
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index d0e9e3d..246e184 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -5,7 +5,6 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
-#include <map>
#include <memory>
#include <set>
#include <string>
@@ -114,7 +113,6 @@
//! Add sources to the target.
void AddSources(std::vector<std::string> const& srcs);
void AddTracedSources(std::vector<std::string> const& srcs);
- std::string GetSourceCMP0049(const std::string& src);
cmSourceFile* AddSource(const std::string& src, bool before = false);
//! how we identify a library, by name and type
@@ -260,9 +258,7 @@
void InsertPrecompileHeader(BT<std::string> const& entry);
void AppendBuildInterfaceIncludes();
- void FinalizeTargetConfiguration(
- const cmBTStringRange& noConfigCompileDefinitions,
- cm::optional<std::map<std::string, cmValue>>& perConfigCompileDefinitions);
+ void FinalizeTargetConfiguration(const cmBTStringRange& compileDefinitions);
std::string GetDebugGeneratorExpressions(const std::string& value,
cmTargetLinkLibraryType llt) const;
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 48f4d4f..b8d853a 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -25,8 +25,6 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetLinkLibraryType.h"
-#include "cmValue.h"
-#include "cmake.h"
namespace {
@@ -95,70 +93,22 @@
}
}
if (!target) {
- MessageType t = MessageType::FATAL_ERROR; // fail by default
- std::ostringstream e;
- e << "Cannot specify link libraries for target \"" << args[0]
- << "\" which is not built by this project.";
- // The bad target is the only argument. Check how policy CMP0016 is set,
- // and accept, warn or fail respectively:
- if (args.size() < 2) {
- switch (mf.GetPolicyStatus(cmPolicies::CMP0016)) {
- case cmPolicies::WARN:
- t = MessageType::AUTHOR_WARNING;
- // Print the warning.
- e << "\n"
- "CMake does not support this but it used to work accidentally "
- "and is being allowed for compatibility."
- "\n"
- << cmPolicies::GetPolicyWarning(cmPolicies::CMP0016);
- break;
- case cmPolicies::OLD: // OLD behavior does not warn.
- t = MessageType::MESSAGE;
- break;
- case cmPolicies::NEW: // NEW behavior prints the error.
- break;
- }
- }
- // Now actually print the message.
- switch (t) {
- case MessageType::AUTHOR_WARNING:
- mf.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
- break;
- case MessageType::FATAL_ERROR:
- mf.IssueMessage(MessageType::FATAL_ERROR, e.str());
- cmSystemTools::SetFatalErrorOccurred();
- break;
- default:
- break;
- }
+ mf.IssueMessage(MessageType::FATAL_ERROR,
+ cmStrCat("Cannot specify link libraries for target \"",
+ args[0],
+ "\" which is not built by this project."));
+ cmSystemTools::SetFatalErrorOccurred();
return true;
}
// Having a UTILITY library on the LHS is a bug.
if (target->GetType() == cmStateEnums::UTILITY) {
- std::ostringstream e;
- const char* modal = nullptr;
- MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (mf.GetPolicyStatus(cmPolicies::CMP0039)) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0039) << '\n';
- modal = "should";
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- modal = "must";
- messageType = MessageType::FATAL_ERROR;
- break;
- }
- if (modal) {
- e << "Utility target \"" << target->GetName() << "\" " << modal
- << " not be used as the target of a target_link_libraries call.";
- mf.IssueMessage(messageType, e.str());
- if (messageType == MessageType::FATAL_ERROR) {
- return false;
- }
- }
+ mf.IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "Utility target \"", target->GetName(),
+ "\" must not be used as the target of a target_link_libraries call."));
+ return false;
}
// But we might not have any libs after variable expansion.
@@ -358,21 +308,6 @@
cmSystemTools::SetFatalErrorOccurred();
}
- const cmPolicies::PolicyStatus policy22Status =
- target->GetPolicyStatusCMP0022();
-
- // If any of the LINK_ options were given, make sure the
- // LINK_INTERFACE_LIBRARIES target property exists.
- // Use of any of the new keywords implies awareness of
- // this property. And if no libraries are named, it should
- // result in an empty link interface.
- if ((policy22Status == cmPolicies::OLD ||
- policy22Status == cmPolicies::WARN) &&
- currentProcessingState != ProcessingLinkLibraries &&
- !target->GetProperty("LINK_INTERFACE_LIBRARIES")) {
- target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
- }
-
return true;
}
@@ -444,41 +379,22 @@
if (!this->Target->PushTLLCommandTrace(
sig, this->Makefile.GetBacktrace().Top())) {
std::ostringstream e;
- const char* modal = nullptr;
- MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (this->Makefile.GetPolicyStatus(cmPolicies::CMP0023)) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0023) << '\n';
- modal = "should";
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- modal = "must";
- messageType = MessageType::FATAL_ERROR;
- break;
- }
-
- if (modal) {
- // If the sig is a keyword form and there is a conflict, the existing
- // form must be the plain form.
- const char* existingSig =
- (sig == cmTarget::KeywordTLLSignature ? "plain" : "keyword");
- e << "The " << existingSig
- << " signature for target_link_libraries has "
- "already been used with the target \""
- << this->Target->GetName()
- << "\". All uses of target_link_libraries with a target " << modal
- << " be either all-keyword or all-plain.\n";
- this->Target->GetTllSignatureTraces(e,
- sig == cmTarget::KeywordTLLSignature
- ? cmTarget::PlainTLLSignature
- : cmTarget::KeywordTLLSignature);
- this->Makefile.IssueMessage(messageType, e.str());
- if (messageType == MessageType::FATAL_ERROR) {
- return false;
- }
- }
+ // If the sig is a keyword form and there is a conflict, the existing
+ // form must be the plain form.
+ const char* existingSig =
+ (sig == cmTarget::KeywordTLLSignature ? "plain" : "keyword");
+ e << "The " << existingSig
+ << " signature for target_link_libraries has "
+ "already been used with the target \""
+ << this->Target->GetName()
+ << "\". All uses of target_link_libraries with a target must "
+ << " be either all-keyword or all-plain.\n";
+ this->Target->GetTllSignatureTraces(e,
+ sig == cmTarget::KeywordTLLSignature
+ ? cmTarget::PlainTLLSignature
+ : cmTarget::KeywordTLLSignature);
+ this->Makefile.IssueMessage(MessageType::FATAL_ERROR, e.str());
+ return false;
}
// Handle normal case where the command was called with another keyword than
@@ -559,54 +475,6 @@
// property of the target on the LHS shall be populated.)
this->AppendProperty("INTERFACE_LINK_LIBRARIES",
this->Target->GetDebugGeneratorExpressions(lib, llt));
-
- // Stop processing if called without any keyword.
- if (currentProcessingState == ProcessingLinkLibraries) {
- return true;
- }
- // Stop processing if policy CMP0022 is set to NEW.
- const cmPolicies::PolicyStatus policy22Status =
- this->Target->GetPolicyStatusCMP0022();
- if (policy22Status != cmPolicies::OLD &&
- policy22Status != cmPolicies::WARN) {
- return true;
- }
- // Stop processing if called with an INTERFACE library on the LHS.
- if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
- return true;
- }
-
- // Handle (additional) backward-compatibility case where the command was
- // called with PUBLIC / INTERFACE / LINK_PUBLIC / LINK_INTERFACE_LIBRARIES.
- // (The policy CMP0022 is not set to NEW.)
- {
- // Get the list of configurations considered to be DEBUG.
- std::vector<std::string> debugConfigs =
- this->Makefile.GetCMakeInstance()->GetDebugConfigs();
- std::string prop;
-
- // Include this library in the link interface for the target.
- if (llt == DEBUG_LibraryType || llt == GENERAL_LibraryType) {
- // Put in the DEBUG configuration interfaces.
- for (std::string const& dc : debugConfigs) {
- prop = cmStrCat("LINK_INTERFACE_LIBRARIES_", dc);
- this->AppendProperty(prop, lib);
- }
- }
- if (llt == OPTIMIZED_LibraryType || llt == GENERAL_LibraryType) {
- // Put in the non-DEBUG configuration interfaces.
- this->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
-
- // Make sure the DEBUG configuration interfaces exist so that the
- // general one will not be used as a fall-back.
- for (std::string const& dc : debugConfigs) {
- prop = cmStrCat("LINK_INTERFACE_LIBRARIES_", dc);
- if (!this->Target->GetProperty(prop)) {
- this->Target->SetProperty(prop, "");
- }
- }
- }
- }
return true;
}
diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx
index bf9dddd..73b88b5 100644
--- a/Source/cmTargetPropertyComputer.cxx
+++ b/Source/cmTargetPropertyComputer.cxx
@@ -3,39 +3,17 @@
#include "cmTargetPropertyComputer.h"
-#include <sstream>
-
#include "cmMakefile.h"
#include "cmMessageType.h"
-#include "cmPolicies.h"
-bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
+void cmTargetPropertyComputer::IssueLocationPropertyError(
std::string const& tgtName, cmMakefile const& mf)
{
- std::ostringstream e;
- const char* modal = nullptr;
- MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (mf.GetPolicyStatus(cmPolicies::CMP0026)) {
- case cmPolicies::WARN:
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0026) << "\n";
- modal = "should";
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- case cmPolicies::NEW:
- modal = "may";
- messageType = MessageType::FATAL_ERROR;
- break;
- }
-
- if (modal) {
- e << "The LOCATION property " << modal << " not be read from target \""
- << tgtName
- << "\". Use the target name directly with "
- "add_custom_command, or use the generator expression $<TARGET_FILE>, "
- "as appropriate.\n";
- mf.IssueMessage(messageType, e.str());
- }
-
- return messageType != MessageType::FATAL_ERROR;
+ mf.IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "The LOCATION property may not be read from target \"", tgtName,
+ "\". Use the target name directly with "
+ "add_custom_command, or use the generator expression $<TARGET_FILE>, "
+ "as appropriate.\n"));
}
diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h
index a14a3f0..ea50f29 100644
--- a/Source/cmTargetPropertyComputer.h
+++ b/Source/cmTargetPropertyComputer.h
@@ -33,14 +33,12 @@
}
private:
- static bool HandleLocationPropertyPolicy(std::string const& tgtName,
- cmMakefile const& mf);
+ static void IssueLocationPropertyError(std::string const& tgtName,
+ cmMakefile const& mf);
template <typename Target>
- static const std::string& ComputeLocationForBuild(Target const* tgt);
- template <typename Target>
- static const std::string& ComputeLocation(Target const* tgt,
- std::string const& config);
+ static const std::string& ImportedLocation(Target const* tgt,
+ std::string const& config);
template <typename Target>
static cmValue GetLocation(Target const* tgt, std::string const& prop,
@@ -56,21 +54,21 @@
tgt->GetType() == cmStateEnums::UNKNOWN_LIBRARY) {
static const std::string propLOCATION = "LOCATION";
if (prop == propLOCATION) {
- if (!tgt->IsImported() &&
- !HandleLocationPropertyPolicy(tgt->GetName(), mf)) {
+ if (!tgt->IsImported()) {
+ IssueLocationPropertyError(tgt->GetName(), mf);
return nullptr;
}
- return cmValue(ComputeLocationForBuild(tgt));
+ return cmValue(ImportedLocation(tgt, std::string()));
}
// Support "LOCATION_<CONFIG>".
if (cmHasLiteralPrefix(prop, "LOCATION_")) {
- if (!tgt->IsImported() &&
- !HandleLocationPropertyPolicy(tgt->GetName(), mf)) {
+ if (!tgt->IsImported()) {
+ IssueLocationPropertyError(tgt->GetName(), mf);
return nullptr;
}
std::string configName = prop.substr(9);
- return cmValue(ComputeLocation(tgt, configName));
+ return cmValue(ImportedLocation(tgt, configName));
}
// Support "<CONFIG>_LOCATION".
@@ -78,11 +76,11 @@
!cmHasLiteralPrefix(prop, "XCODE_ATTRIBUTE_")) {
std::string configName(prop.c_str(), prop.size() - 9);
if (configName != "IMPORTED") {
- if (!tgt->IsImported() &&
- !HandleLocationPropertyPolicy(tgt->GetName(), mf)) {
+ if (!tgt->IsImported()) {
+ IssueLocationPropertyError(tgt->GetName(), mf);
return nullptr;
}
- return cmValue(ComputeLocation(tgt, configName));
+ return cmValue(ImportedLocation(tgt, configName));
}
}
}
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx
deleted file mode 100644
index 1fd386b..0000000
--- a/Source/cmUseMangledMesaCommand.cxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmUseMangledMesaCommand.h"
-
-#include "cmsys/FStream.hxx"
-#include "cmsys/RegularExpression.hxx"
-
-#include "cmExecutionStatus.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-
-namespace {
-void CopyAndFullPathMesaHeader(const std::string& source,
- const std::string& outdir);
-}
-
-bool cmUseMangledMesaCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status)
-{
- // expected two arguments:
- // argument one: the full path to gl_mangle.h
- // argument two : directory for output of edited headers
- if (args.size() != 2) {
- status.SetError("called with incorrect number of arguments");
- return false;
- }
- const std::string& inputDir = args[0];
- std::string glh = cmStrCat(inputDir, "/gl.h");
- if (!cmSystemTools::FileExists(glh)) {
- std::string e = cmStrCat("Bad path to Mesa, could not find: ", glh, ' ');
- status.SetError(e);
- return false;
- }
- const std::string& destDir = args[1];
- std::vector<std::string> files;
- cmSystemTools::Glob(inputDir, "\\.h$", files);
- if (files.empty()) {
- cmSystemTools::Error("Could not open Mesa Directory " + inputDir);
- return false;
- }
- cmSystemTools::MakeDirectory(destDir);
- for (std::string const& f : files) {
- std::string path = cmStrCat(inputDir, '/', f);
- CopyAndFullPathMesaHeader(path, destDir);
- }
-
- return true;
-}
-
-namespace {
-void CopyAndFullPathMesaHeader(const std::string& source,
- const std::string& outdir)
-{
- std::string dir;
- std::string file;
- cmSystemTools::SplitProgramPath(source, dir, file);
- std::string outFile = cmStrCat(outdir, '/', file);
- std::string tempOutputFile = cmStrCat(outFile, ".tmp");
- cmsys::ofstream fout(tempOutputFile.c_str());
- if (!fout) {
- cmSystemTools::Error("Could not open file for write in copy operation: " +
- tempOutputFile + outdir);
- cmSystemTools::ReportLastSystemError("");
- return;
- }
- cmsys::ifstream fin(source.c_str());
- if (!fin) {
- cmSystemTools::Error("Could not open file for read in copy operation" +
- source);
- return;
- }
- // now copy input to output and expand variables in the
- // input file at the same time
- std::string inLine;
- // regular expression for any #include line
- cmsys::RegularExpression includeLine(
- "^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]");
- // regular expression for gl/ or GL/ in a file (match(1) of above)
- cmsys::RegularExpression glDirLine(R"((gl|GL)(/|\\)([^<"]+))");
- // regular expression for gl GL or xmesa in a file (match(1) of above)
- cmsys::RegularExpression glLine("(gl|GL|xmesa)");
- while (cmSystemTools::GetLineFromStream(fin, inLine)) {
- if (includeLine.find(inLine)) {
- std::string includeFile = includeLine.match(1);
- if (glDirLine.find(includeFile)) {
- std::string gfile = glDirLine.match(3);
- fout << "#include \"" << outdir << "/" << gfile << "\"\n";
- } else if (glLine.find(includeFile)) {
- fout << "#include \"" << outdir << "/" << includeLine.match(1)
- << "\"\n";
- } else {
- fout << inLine << "\n";
- }
- } else {
- fout << inLine << "\n";
- }
- }
- // close the files before attempting to copy
- fin.close();
- fout.close();
- cmSystemTools::MoveFileIfDifferent(tempOutputFile, outFile);
-}
-}
diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h
deleted file mode 100644
index 5670c5d..0000000
--- a/Source/cmUseMangledMesaCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmUseMangledMesaCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
deleted file mode 100644
index 2805a33..0000000
--- a/Source/cmUtilitySourceCommand.cxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmUtilitySourceCommand.h"
-
-#include <cstring>
-
-#include "cmExecutionStatus.h"
-#include "cmMakefile.h"
-#include "cmState.h"
-#include "cmStateTypes.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-#include "cmValue.h"
-
-// cmUtilitySourceCommand
-bool cmUtilitySourceCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status)
-{
- if (args.size() < 3) {
- status.SetError("called with incorrect number of arguments");
- return false;
- }
-
- auto arg = args.begin();
-
- // The first argument is the cache entry name.
- std::string const& cacheEntry = *arg++;
- cmValue cacheValue = status.GetMakefile().GetDefinition(cacheEntry);
- // If it exists already and appears up to date then we are done. If
- // the string contains "(IntDir)" but that is not the
- // CMAKE_CFG_INTDIR setting then the value is out of date.
- std::string const& intDir =
- status.GetMakefile().GetRequiredDefinition("CMAKE_CFG_INTDIR");
-
- bool haveCacheValue = false;
- if (status.GetMakefile().IsOn("CMAKE_CROSSCOMPILING")) {
- haveCacheValue = (cacheValue != nullptr);
- if (!haveCacheValue) {
- std::string msg = cmStrCat(
- "UTILITY_SOURCE is used in cross compiling mode for ", cacheEntry,
- ". If your intention is to run this executable, you need to "
- "preload the cache with the full path to a version of that "
- "program, which runs on this build machine.");
- cmSystemTools::Message(msg, "Warning");
- }
- } else {
- cmState* state = status.GetMakefile().GetState();
- haveCacheValue = (cacheValue &&
- (strstr(cacheValue->c_str(), "(IntDir)") == nullptr ||
- (intDir == "$(IntDir)")) &&
- (state->GetCacheMajorVersion() != 0 &&
- state->GetCacheMinorVersion() != 0));
- }
-
- if (haveCacheValue) {
- return true;
- }
-
- // The second argument is the utility's executable name, which will be
- // needed later.
- std::string const& utilityName = *arg++;
-
- // The third argument specifies the relative directory of the source
- // of the utility.
- std::string const& relativeSource = *arg++;
- std::string utilitySource = status.GetMakefile().GetCurrentSourceDirectory();
- utilitySource = utilitySource + "/" + relativeSource;
-
- // If the directory doesn't exist, the source has not been included.
- if (!cmSystemTools::FileExists(utilitySource)) {
- return true;
- }
-
- // Make sure all the files exist in the source directory.
- while (arg != args.end()) {
- std::string file = utilitySource + "/" + *arg++;
- if (!cmSystemTools::FileExists(file)) {
- return true;
- }
- }
-
- // The source exists.
- const std::string& cmakeCFGout =
- status.GetMakefile().GetRequiredDefinition("CMAKE_CFG_INTDIR");
- std::string utilityDirectory =
- status.GetMakefile().GetCurrentBinaryDirectory();
- std::string exePath;
- if (cmValue d =
- status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH")) {
- exePath = *d;
- }
- if (!exePath.empty()) {
- utilityDirectory = exePath;
- } else {
- utilityDirectory += "/" + relativeSource;
- }
-
- // Construct the cache entry for the executable's location.
- std::string utilityExecutable = utilityDirectory + "/" + cmakeCFGout + "/" +
- utilityName +
- *status.GetMakefile().GetDefinition("CMAKE_EXECUTABLE_SUFFIX");
-
- // make sure we remove any /./ in the name
- cmSystemTools::ReplaceString(utilityExecutable, "/./", "/");
-
- // Enter the value into the cache.
- status.GetMakefile().AddCacheDefinition(cacheEntry, utilityExecutable,
- "Path to an internal program.",
- cmStateEnums::FILEPATH);
- // add a value into the cache that maps from the
- // full path to the name of the project
- cmSystemTools::ConvertToUnixSlashes(utilityExecutable);
- status.GetMakefile().AddCacheDefinition(utilityExecutable, utilityName,
- "Executable to project name.",
- cmStateEnums::INTERNAL);
-
- return true;
-}
diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h
deleted file mode 100644
index 8cf7e7f..0000000
--- a/Source/cmUtilitySourceCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmUtilitySourceCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx
deleted file mode 100644
index 2b1efba..0000000
--- a/Source/cmVariableRequiresCommand.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmVariableRequiresCommand.h"
-
-#include "cmExecutionStatus.h"
-#include "cmMakefile.h"
-#include "cmState.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-#include "cmValue.h"
-
-// cmLibraryCommand
-bool cmVariableRequiresCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status)
-{
- if (args.size() < 3) {
- status.SetError("called with incorrect number of arguments");
- return false;
- }
-
- std::string const& testVariable = args[0];
- if (!status.GetMakefile().IsOn(testVariable)) {
- return true;
- }
- std::string const& resultVariable = args[1];
- bool requirementsMet = true;
- std::string notSet;
- bool hasAdvanced = false;
- cmState* state = status.GetMakefile().GetState();
- for (unsigned int i = 2; i < args.size(); ++i) {
- if (!status.GetMakefile().IsOn(args[i])) {
- requirementsMet = false;
- notSet += args[i];
- notSet += "\n";
- if (state->GetCacheEntryValue(args[i]) &&
- state->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) {
- hasAdvanced = true;
- }
- }
- }
- cmValue reqVar = status.GetMakefile().GetDefinition(resultVariable);
- // if reqVar is unset, then set it to requirementsMet
- // if reqVar is set to true, but requirementsMet is false , then
- // set reqVar to false.
- if (!reqVar || (!requirementsMet && status.GetMakefile().IsOn(*reqVar))) {
- status.GetMakefile().AddDefinitionBool(resultVariable, requirementsMet);
- }
-
- if (!requirementsMet) {
- std::string message =
- cmStrCat("Variable assertion failed:\n", testVariable,
- " Requires that the following unset variables are set:\n",
- notSet, "\nPlease set them, or set ", testVariable,
- " to false, and re-configure.\n");
- if (hasAdvanced) {
- message +=
- "One or more of the required variables is advanced."
- " To set the variable, you must turn on advanced mode in cmake.";
- }
- cmSystemTools::Error(message);
- }
-
- return true;
-}
diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h
deleted file mode 100644
index c6bfe8a..0000000
--- a/Source/cmVariableRequiresCommand.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <string>
-#include <vector>
-
-class cmExecutionStatus;
-
-bool cmVariableRequiresCommand(std::vector<std::string> const& args,
- cmExecutionStatus& status);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 95f4a92..8615c5b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2650,27 +2650,6 @@
// 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") &&
@@ -2703,9 +2682,10 @@
"--output <OBJECT> --source <SOURCE> --language <LANGUAGE> -- "));
this->State->SetGlobalProperty(
"RULE_LAUNCH_LINK",
- cmStrCat(launcher, "--command-type link", common_args,
- "--output <TARGET> --target-type <TARGET_TYPE> ",
- "--language <LANGUAGE> -- "));
+ cmStrCat(
+ launcher, "--command-type link", common_args,
+ "--output <TARGET> --target-type <TARGET_TYPE> ",
+ "--language <LANGUAGE> --target-labels \"<TARGET_LABELS>\" -- "));
this->State->SetGlobalProperty(
"RULE_LAUNCH_CUSTOM",
cmStrCat(launcher, "--command-type custom", common_args,
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 341b135..1e76ab6 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -1,7 +1,4 @@
-# Using 2.8 will trigger a deprecation warning. In this case it's explicitly
-# intentional since the tests checks various policy implementations prior to
-# 3.10
-cmake_minimum_required(VERSION 2.8.11) # old enough to not set CMP0022
+cmake_minimum_required(VERSION 3.10)
if(POLICY CMP0129)
cmake_policy(SET CMP0129 NEW)
@@ -53,38 +50,38 @@
target_link_libraries(depC LINK_PUBLIC depA LINK_PUBLIC depA)
-assert_property(depA LINK_INTERFACE_LIBRARIES "")
-assert_property(depB LINK_INTERFACE_LIBRARIES "")
-assert_property(depC LINK_INTERFACE_LIBRARIES "depA;depA")
+assert_property(depA INTERFACE_LINK_LIBRARIES "")
+assert_property(depB INTERFACE_LINK_LIBRARIES "")
+assert_property(depC INTERFACE_LINK_LIBRARIES "depA;depA")
add_executable(targetA targetA.cpp)
target_link_libraries(targetA LINK_INTERFACE_LIBRARIES depA depB)
-assert_property(targetA LINK_INTERFACE_LIBRARIES "depA;depB")
+assert_property(targetA INTERFACE_LINK_LIBRARIES "depA;depB")
-set_target_properties(targetA PROPERTIES LINK_INTERFACE_LIBRARIES "")
+set_target_properties(targetA PROPERTIES INTERFACE_LINK_LIBRARIES "")
-assert_property(targetA LINK_INTERFACE_LIBRARIES "")
+assert_property(targetA INTERFACE_LINK_LIBRARIES "")
add_subdirectory(subdir)
target_link_libraries(targetA subdirlib)
target_link_libraries(targetA depB depC)
-assert_property(targetA LINK_INTERFACE_LIBRARIES "")
+assert_property(targetA INTERFACE_LINK_LIBRARIES ";subdirlib;depB;depC")
# Exclude depIfaceOnly from ALL so that it will only be built if something
# depends on it. As it is in the link interface of depB, targetA
# will depend on it. That dependency is what is being tested here.
add_library(depIfaceOnly SHARED EXCLUDE_FROM_ALL depIfaceOnly.cpp)
generate_export_header(depIfaceOnly)
-set_property(TARGET depB APPEND PROPERTY LINK_INTERFACE_LIBRARIES depIfaceOnly)
+set_property(TARGET depB APPEND PROPERTY INTERFACE_LINK_LIBRARIES depIfaceOnly)
add_library(depD SHARED depD.cpp)
generate_export_header(depD)
set_property(TARGET depD APPEND PROPERTY
- LINK_INTERFACE_LIBRARIES
+ INTERFACE_LINK_LIBRARIES
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depA>
)
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
index ebade02..59e94ae 100644
--- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0028 NEW)
-
include(GenerateExportHeader)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2b0e02a..d69f433 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -468,9 +468,6 @@
ADD_TEST_MACRO(SetLang SetLangX)
ADD_TEST_MACRO(EmptyProperty EmptyProperty)
ADD_TEST_MACRO(ExternalOBJ ExternalOBJ)
- if(NOT CMake_TEST_EXTERNAL_CMAKE)
- ADD_TEST_MACRO(LoadCommand LoadedCommand)
- endif()
ADD_TEST_MACRO(LinkDirectory bin/LinkDirectory)
ADD_TEST_MACRO(LinkLanguage LinkLanguage)
ADD_TEST_MACRO(LinkLine LinkLine)
@@ -545,9 +542,6 @@
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)
@@ -1337,18 +1331,6 @@
set_property(TEST CMakeTestAllGenerators PROPERTY RUN_SERIAL 1)
endif()
- if(NOT CMake_TEST_EXTERNAL_CMAKE)
- add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig"
- "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
- ${build_generator_args}
- --build-project LoadCommand
- --test-command LoadedCommand
- )
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
- endif()
-
add_test(complex ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Complex"
diff --git a/Tests/CMakeTests/IfTest.cmake.in b/Tests/CMakeTests/IfTest.cmake.in
index e5211b4..e783d8d 100644
--- a/Tests/CMakeTests/IfTest.cmake.in
+++ b/Tests/CMakeTests/IfTest.cmake.in
@@ -40,60 +40,6 @@
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})
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index 0120c84..118be6c 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -152,33 +152,10 @@
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")
diff --git a/Tests/CompileDefinitions/compiletest.c b/Tests/CompileDefinitions/compiletest.c
index 6624866..764161e 100644
--- a/Tests/CompileDefinitions/compiletest.c
+++ b/Tests/CompileDefinitions/compiletest.c
@@ -13,10 +13,6 @@
# error Unexpected LINK_LANGUAGE_IS_CXX
#endif
-#ifdef DEBUG_MODE
-# error Unexpected DEBUG_MODE
-#endif
-
int main(void)
{
return 0;
diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
index 311975c..f47f7f0 100644
--- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt
+++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
@@ -35,9 +35,6 @@
add_executable(target_prop_c_executable ../compiletest.c)
-cmake_policy(SET CMP0043 NEW)
-set_property(TARGET target_prop_c_executable APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG_MODE)
-
set_property(TARGET target_prop_c_executable APPEND PROPERTY COMPILE_DEFINITIONS
"$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:LINK_CXX_DEFINE>"
"$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:LINK_C_DEFINE>"
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 3c1f995..ce27bde 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -19,31 +19,6 @@
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
- CMP0029
- CMP0032
- CMP0033
- CMP0034
- CMP0043
- CMP0050
- )
- if(POLICY ${p})
- cmake_policy(SET ${p} OLD)
- endif()
-endforeach()
-
# Test building without per-rule echo lines in Makefiles.
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
@@ -115,18 +90,6 @@
add_definitions(-DCMAKE_IS_FUN)
add_definitions(-DCMAKE_IS_REALLY_FUN)
-set_property(DIRECTORY
- PROPERTY COMPILE_DEFINITIONS_RELEASE
- CMAKE_IS_FUN_IN_RELEASE_MODE
- )
-set_property(DIRECTORY
- PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO
- CMAKE_IS_FUN_IN_RELEASE_MODE
- )
-set_property(DIRECTORY
- PROPERTY COMPILE_DEFINITIONS_MINSIZEREL
- CMAKE_IS_FUN_IN_RELEASE_MODE
- )
set(TEST_SEP "a b c")
separate_arguments(TEST_SEP)
@@ -449,6 +412,3 @@
#
add_subdirectory(Library)
add_subdirectory(Executable)
-subdir_depends(Executable Library)
-export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
-include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index c8668b9..c382dd1 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -110,14 +110,14 @@
)
set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG")
add_custom_command(
- TARGET complex
- SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
+ MAIN_DEPENDENCY ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
- OUTPUTS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
+ OUTPUT ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
DEPENDS ${CMAKE_COMMAND}
)
+target_sources(complex PRIVATE ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h)
# Test creating an executable that is not built by default.
add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx)
@@ -133,15 +133,6 @@
add_custom_target(notInAllCustom)
add_dependencies(notInAllCustom notInAllExe)
-#
-# Output the files required by 'complex' to a file.
-#
-# This test has been moved to the 'required' subdir so that it
-# has no side-effects on the current Makefile (duplicated source file
-# due to source list expansion done twice).
-#
-add_subdirectory(Temp)
-
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX
AND NOT XCODE) # XCODE is excluded due to #15687
add_executable(testSystemDir testSystemDir.cxx)
diff --git a/Tests/Complex/Executable/Temp/CMakeLists.txt b/Tests/Complex/Executable/Temp/CMakeLists.txt
deleted file mode 100644
index 041fcff..0000000
--- a/Tests/Complex/Executable/Temp/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Output the files required by 'complex' to a file.
-# The 'complex' executable will then test if this file exists and remove it.
-# The contents of this file is not tested (absolute paths).
-#
-output_required_files(
- ${Complex_SOURCE_DIR}/Executable/complex.cxx
- ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 50f9932..0e2463a 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -62,10 +62,6 @@
# error This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work
#endif
-#if defined(COMPLEX_NDEBUG) && !defined(CMAKE_IS_FUN_IN_RELEASE_MODE)
-# error Per-configuration directory-level definition not inherited.
-#endif
-
// ======================================================================
void TestAndRemoveFile(const char* filename)
@@ -243,7 +239,7 @@
#endif
// ----------------------------------------------------------------------
- // Test SET, VARIABLE_REQUIRES
+ // Test SET
#ifdef SHOULD_NOT_BE_DEFINED
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED is defined.");
@@ -269,13 +265,6 @@
cmPassed("ONE_VAR_AND_INDENTED is defined.");
#endif
-#ifndef ONE_VAR_IS_DEFINED
- cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
- "ONE_VAR_IS_DEFINED is not defined.");
-#else
- cmPassed("ONE_VAR_IS_DEFINED is defined.");
-#endif
-
#ifdef ZERO_VAR
cmFailed("cmakedefine is broken, ZERO_VAR is defined.");
#else
@@ -893,17 +882,6 @@
TestDir("make_dir");
// ----------------------------------------------------------------------
- // Test OUTPUT_REQUIRED_FILES
- // The files required by 'complex' have been output to a file.
- // The contents of this file is not tested (absolute paths).
- //
- // WARNING: if you run 'complex' manually, this *will* fail, because
- // the file was removed the last time 'complex' was run, and it is
- // only created during a build.
-
- TestAndRemoveFile("Executable/Temp/complex-required.txt");
-
- // ----------------------------------------------------------------------
// Test FIND_LIBRARY
#ifndef FIND_DUMMY_LIB
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 5ffb673..f70b557 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -1,11 +1,6 @@
remove_definitions(-DCMAKE_IS_REALLY_FUN)
-#
-# Small utility used to create file
-# UTILITY_SOURCE is used for coverage and for getting the exact name
-# of the executable.
-#
-utility_source(CREATE_FILE_EXE create_file "." create_file.cxx)
+set(CREATE_FILE_EXE create_file CACHE INTERNAL "") # make globally visible
add_executable(create_file create_file.cxx)
set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake
index eacf84b..5dcf7a5 100644
--- a/Tests/Complex/VarTests.cmake
+++ b/Tests/Complex/VarTests.cmake
@@ -17,15 +17,6 @@
set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
#
-# Test VARIABLE_REQUIRES
-#
-block(SCOPE_FOR POLICIES)
-cmake_policy(VERSION 2.8.12) # old enough to not set CMP0035
-variable_requires(ONE_VAR
- ONE_VAR_IS_DEFINED ONE_VAR)
-endblock()
-
-#
# Test various IF/ELSE combinations
#
if(NOT ZERO_VAR)
diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in
index 96045d1..63d47eb 100644
--- a/Tests/Complex/cmTestConfigure.h.in
+++ b/Tests/Complex/cmTestConfigure.h.in
@@ -1,8 +1,7 @@
-// Test SET, VARIABLE_REQUIRES
+// Test SET
#cmakedefine ONE_VAR
# cmakedefine ONE_VAR_AND_INDENTED
-#cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR
# cmakedefine ZERO_VAR_AND_INDENTED
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index e0e9289..8725980 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -12,31 +12,6 @@
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
- CMP0029
- CMP0032
- CMP0033
- CMP0034
- CMP0043
- CMP0050
- )
- if(POLICY ${p})
- cmake_policy(SET ${p} OLD)
- endif()
-endforeach()
-
# Test building without per-rule echo lines in Makefiles.
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
@@ -102,18 +77,6 @@
add_definitions(-DCMAKE_IS_FUN)
add_definitions(-DCMAKE_IS_REALLY_FUN)
-set_property(DIRECTORY
- PROPERTY COMPILE_DEFINITIONS_RELEASE
- CMAKE_IS_FUN_IN_RELEASE_MODE
- )
-set_property(DIRECTORY
- PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO
- CMAKE_IS_FUN_IN_RELEASE_MODE
- )
-set_property(DIRECTORY
- PROPERTY COMPILE_DEFINITIONS_MINSIZEREL
- CMAKE_IS_FUN_IN_RELEASE_MODE
- )
set(TEST_SEP "a b c")
separate_arguments(TEST_SEP)
@@ -406,6 +369,3 @@
#
add_subdirectory(Library)
add_subdirectory(Executable)
-subdir_depends(Executable Library)
-export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
-include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
index a8ab17b..66c45e5 100644
--- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
@@ -110,14 +110,14 @@
)
set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG")
add_custom_command(
- TARGET complex
- SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
+ MAIN_DEPENDENCY ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
- OUTPUTS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
+ OUTPUT ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
DEPENDS ${CMAKE_COMMAND}
)
+target_sources(complex PRIVATE ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h)
# Test creating an executable that is not built by default.
add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx)
@@ -133,15 +133,6 @@
add_custom_target(notInAllCustom)
add_dependencies(notInAllCustom notInAllExe)
-#
-# Output the files required by 'complex' to a file.
-#
-# This test has been moved to the 'required' subdir so that it
-# has no side-effects on the current Makefile (duplicated source file
-# due to source list expansion done twice).
-#
-add_subdirectory(Temp)
-
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX
AND NOT XCODE) # XCODE is excluded due to #15687
add_executable(testSystemDir testSystemDir.cxx)
diff --git a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
deleted file mode 100644
index 041fcff..0000000
--- a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Output the files required by 'complex' to a file.
-# The 'complex' executable will then test if this file exists and remove it.
-# The contents of this file is not tested (absolute paths).
-#
-output_required_files(
- ${Complex_SOURCE_DIR}/Executable/complex.cxx
- ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index f0fc2fe..1c2a316 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -62,10 +62,6 @@
# error This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work
#endif
-#if defined(COMPLEX_NDEBUG) && !defined(CMAKE_IS_FUN_IN_RELEASE_MODE)
-# error Per-configuration directory-level definition not inherited.
-#endif
-
// ======================================================================
void TestAndRemoveFile(const char* filename)
@@ -243,7 +239,7 @@
#endif
// ----------------------------------------------------------------------
- // Test SET, VARIABLE_REQUIRES
+ // Test SET
#ifdef SHOULD_NOT_BE_DEFINED
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED is defined.");
@@ -269,13 +265,6 @@
cmPassed("ONE_VAR_AND_INDENTED is defined.");
#endif
-#ifndef ONE_VAR_IS_DEFINED
- cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
- "ONE_VAR_IS_DEFINED is not defined.");
-#else
- cmPassed("ONE_VAR_IS_DEFINED is defined.");
-#endif
-
#ifdef ZERO_VAR
cmFailed("cmakedefine is broken, ZERO_VAR is defined.");
#else
@@ -893,17 +882,6 @@
TestDir("make_dir");
// ----------------------------------------------------------------------
- // Test OUTPUT_REQUIRED_FILES
- // The files required by 'complex' have been output to a file.
- // The contents of this file is not tested (absolute paths).
- //
- // WARNING: if you run 'complex' manually, this *will* fail, because
- // the file was removed the last time 'complex' was run, and it is
- // only created during a build.
-
- TestAndRemoveFile("Executable/Temp/complex-required.txt");
-
- // ----------------------------------------------------------------------
// Test FIND_LIBRARY
#ifndef FIND_DUMMY_LIB
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index 5ffb673..f70b557 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -1,11 +1,6 @@
remove_definitions(-DCMAKE_IS_REALLY_FUN)
-#
-# Small utility used to create file
-# UTILITY_SOURCE is used for coverage and for getting the exact name
-# of the executable.
-#
-utility_source(CREATE_FILE_EXE create_file "." create_file.cxx)
+set(CREATE_FILE_EXE create_file CACHE INTERNAL "") # make globally visible
add_executable(create_file create_file.cxx)
set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake
index 1e3a74f..e28d01b 100644
--- a/Tests/ComplexOneConfig/VarTests.cmake
+++ b/Tests/ComplexOneConfig/VarTests.cmake
@@ -17,15 +17,6 @@
set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
#
-# Test VARIABLE_REQUIRES
-#
-block(SCOPE_FOR POLICIES)
-cmake_policy(VERSION 2.8.12) # old enough to not set CMP0035
-variable_requires(ONE_VAR
- ONE_VAR_IS_DEFINED ONE_VAR)
-endblock()
-
-#
# Test various IF/ELSE combinations
#
if(NOT ZERO_VAR)
diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in
index 96045d1..63d47eb 100644
--- a/Tests/ComplexOneConfig/cmTestConfigure.h.in
+++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in
@@ -1,8 +1,7 @@
-// Test SET, VARIABLE_REQUIRES
+// Test SET
#cmakedefine ONE_VAR
# cmakedefine ONE_VAR_AND_INDENTED
-#cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR
# cmakedefine ZERO_VAR_AND_INDENTED
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index f6d32b8..3a6a0eb 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -1,5 +1,5 @@
set(CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES "1942b4fa-b2c5-4546-9385-83f254070067")
-cmake_minimum_required(VERSION 2.8.11) # old enough to not set CMP0022
+cmake_minimum_required(VERSION 3.10)
if(POLICY CMP0129)
cmake_policy(SET CMP0129 NEW)
endif()
@@ -22,10 +22,9 @@
set_property(TARGET testExe2libImp PROPERTY LIBRARY_OUTPUT_DIRECTORY impl)
add_library(testExe2lib SHARED testExe2lib.c)
target_link_libraries(testExe2lib testExe2libImp)
-set_property(TARGET testExe2lib PROPERTY LINK_INTERFACE_LIBRARIES "")
add_executable(testExe2 testExe2.c)
set_property(TARGET testExe2 PROPERTY ENABLE_EXPORTS 1)
-set_property(TARGET testExe2 PROPERTY LINK_INTERFACE_LIBRARIES testExe2lib)
+set_property(TARGET testExe2 PROPERTY INTERFACE_LINK_LIBRARIES testExe2lib)
add_library(compileOnly INTERFACE)
target_compile_definitions(compileOnly INTERFACE FROM_compileOnly)
@@ -36,7 +35,6 @@
add_library(testLib1 STATIC testLib1.c)
add_library(testLib2 STATIC testLib2.c)
-target_link_libraries(testLib2 testLib1)
target_link_libraries(testLib2
PRIVATE
testLib1
@@ -68,7 +66,6 @@
target_link_libraries(testLib3Imp testLib3ImpDep)
add_library(testLib3 SHARED testLib3.c)
target_link_libraries(testLib3 testLib3Imp)
-set_property(TARGET testLib3 PROPERTY LINK_INTERFACE_LIBRARIES "")
set_property(TARGET testLib3 PROPERTY VERSION 1.2)
set_property(TARGET testLib3 PROPERTY SOVERSION 3)
@@ -108,8 +105,6 @@
set(maybe_OBJECTS_DESTINATION "")
endif()
-cmake_policy(PUSH)
-cmake_policy(SET CMP0022 NEW)
add_library(testLib9ObjPub OBJECT testLib9ObjPub.c)
target_compile_definitions(testLib9ObjPub INTERFACE testLib9ObjPub_USED)
add_library(testLib9ObjPriv OBJECT testLib9ObjPriv.c)
@@ -119,41 +114,37 @@
add_library(testLib9 STATIC testLib9.c)
target_link_libraries(testLib9 INTERFACE testLib9ObjIface PUBLIC testLib9ObjPub PRIVATE testLib9ObjPriv)
target_link_libraries(testLib9 PUBLIC Foo::Foo)
-cmake_policy(POP)
-block()
- cmake_policy(SET CMP0022 NEW)
- add_library(testLib10 STATIC testLib10.c)
- set_target_properties(testLib10 PROPERTIES
- TRANSITIVE_COMPILE_PROPERTIES "CUSTOM_C"
- TRANSITIVE_LINK_PROPERTIES "CUSTOM_L"
- INTERFACE_CUSTOM_C "TESTLIB10_INTERFACE_CUSTOM_C"
- INTERFACE_CUSTOM_L "TESTLIB10_INTERFACE_CUSTOM_L"
- )
- target_compile_definitions(testLib10 INTERFACE
- "$<TARGET_PROPERTY:CUSTOM_C>"
- "$<TARGET_PROPERTY:CUSTOM_L>"
- )
- add_library(testLib11 STATIC testLib11.c)
- target_link_libraries(testLib11 PRIVATE testLib10)
- set_target_properties(testLib11 PROPERTIES
- INTERFACE_CUSTOM_C "TESTLIB11_INTERFACE_CUSTOM_C"
- INTERFACE_CUSTOM_L "TESTLIB11_INTERFACE_CUSTOM_L"
- TRANSITIVE_COMPILE_PROPERTIES "CUSTOM_D"
- TRANSITIVE_LINK_PROPERTIES "CUSTOM_M"
- INTERFACE_CUSTOM_D "TESTLIB11_INTERFACE_CUSTOM_D"
- INTERFACE_CUSTOM_M "TESTLIB11_INTERFACE_CUSTOM_M"
- )
- target_compile_definitions(testLib11 INTERFACE
- "$<TARGET_PROPERTY:CUSTOM_C>"
- "$<TARGET_PROPERTY:CUSTOM_D>"
- "$<TARGET_PROPERTY:CUSTOM_L>"
- "$<TARGET_PROPERTY:CUSTOM_M>"
- )
-endblock()
+add_library(testLib10 STATIC testLib10.c)
+set_target_properties(testLib10 PROPERTIES
+ TRANSITIVE_COMPILE_PROPERTIES "CUSTOM_C"
+ TRANSITIVE_LINK_PROPERTIES "CUSTOM_L"
+ INTERFACE_CUSTOM_C "TESTLIB10_INTERFACE_CUSTOM_C"
+ INTERFACE_CUSTOM_L "TESTLIB10_INTERFACE_CUSTOM_L"
+ )
+target_compile_definitions(testLib10 INTERFACE
+ "$<TARGET_PROPERTY:CUSTOM_C>"
+ "$<TARGET_PROPERTY:CUSTOM_L>"
+ )
+add_library(testLib11 STATIC testLib11.c)
+target_link_libraries(testLib11 PRIVATE testLib10)
+set_target_properties(testLib11 PROPERTIES
+ INTERFACE_CUSTOM_C "TESTLIB11_INTERFACE_CUSTOM_C"
+ INTERFACE_CUSTOM_L "TESTLIB11_INTERFACE_CUSTOM_L"
+ TRANSITIVE_COMPILE_PROPERTIES "CUSTOM_D"
+ TRANSITIVE_LINK_PROPERTIES "CUSTOM_M"
+ INTERFACE_CUSTOM_D "TESTLIB11_INTERFACE_CUSTOM_D"
+ INTERFACE_CUSTOM_M "TESTLIB11_INTERFACE_CUSTOM_M"
+ )
+target_compile_definitions(testLib11 INTERFACE
+ "$<TARGET_PROPERTY:CUSTOM_C>"
+ "$<TARGET_PROPERTY:CUSTOM_D>"
+ "$<TARGET_PROPERTY:CUSTOM_L>"
+ "$<TARGET_PROPERTY:CUSTOM_M>"
+ )
# Test using the target_link_libraries command to set the
-# LINK_INTERFACE_LIBRARIES* properties. We construct two libraries
+# INTERFACE_LINK_LIBRARIES properties. We construct two libraries
# providing the same two symbols. In each library one of the symbols
# will work and the other one will fail to link. The import part of
# this test will try to use the symbol corresponding to the
@@ -166,7 +157,7 @@
set_property(TARGET testLib4libopt PROPERTY COMPILE_DEFINITIONS LIB_OPT)
target_link_libraries(testLib4
LINK_INTERFACE_LIBRARIES
- testLib4lib debug testLib4libdbg optimized testLib4libopt
+ testLib4lib debug $<TARGET_NAME:testLib4libdbg> optimized $<TARGET_NAME:testLib4libopt>
)
add_executable(testExe3 testExe3.c)
@@ -219,9 +210,6 @@
DESTINATION include/testInterfaceIncludeUser
)
-cmake_policy(PUSH)
-cmake_policy(SET CMP0022 NEW)
-
# Test control over direct linking.
include(../../InterfaceLinkLibrariesDirect/testStaticLibPlugin.cmake)
include(../../InterfaceLinkLibrariesDirect/testSharedLibWithHelper.cmake)
@@ -237,10 +225,8 @@
target_link_libraries(testLibDepends LINK_PUBLIC testLibRequired)
add_library(testStaticLibRequiredPrivate testStaticLibRequiredPrivate.c)
target_link_libraries(testLibDepends PRIVATE testStaticLibRequiredPrivate)
-cmake_policy(POP)
cmake_policy(PUSH)
-cmake_policy(SET CMP0022 NEW)
cmake_policy(SET CMP0079 NEW)
add_library(TopDirLib STATIC testTopDirLib.c)
add_subdirectory(SubDirLinkA)
@@ -387,8 +373,6 @@
DESTINATION include/testSharedLibRequiredUser
)
-cmake_policy(PUSH)
-cmake_policy(SET CMP0022 NEW)
add_library(testSharedLibRequiredUser2 SHARED testSharedLibRequiredUser2.cpp)
generate_export_header(testSharedLibRequiredUser2)
set_property(TARGET testSharedLibRequiredUser2 APPEND PROPERTY
@@ -401,7 +385,6 @@
"${CMAKE_CURRENT_BINARY_DIR}/testsharedlibrequireduser2_export.h"
DESTINATION include/testSharedLibRequiredUser2
)
-cmake_policy(POP)
cmake_policy(PUSH)
cmake_policy(SET CMP0041 NEW)
@@ -426,28 +409,17 @@
)
cmake_policy(POP)
-# LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above.
target_link_libraries(testSharedLibDepends LINK_PRIVATE testSharedLibRequired)
target_link_libraries(testSharedLibDepends LINK_PUBLIC renamed_on_export)
-target_link_libraries(testSharedLibDepends LINK_INTERFACE_LIBRARIES
+target_link_libraries(testSharedLibDepends INTERFACE
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:$<TARGET_NAME:testSharedLibRequired>>)
-cmake_policy(PUSH)
-cmake_policy(SET CMP0022 OLD)
-add_library(cmp0022OLD SHARED cmp0022_vs6_1.cpp)
-generate_export_header(cmp0022OLD BASE_NAME cmp0022)
-target_include_directories(cmp0022OLD PUBLIC
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/cmp0022>"
-)
-cmake_policy(SET CMP0022 NEW)
add_library(cmp0022NEW SHARED cmp0022_vs6_1.cpp)
-set_property(TARGET cmp0022NEW PROPERTY DEFINE_SYMBOL cmp0022OLD_EXPORTS)
+generate_export_header(cmp0022NEW BASE_NAME cmp0022)
target_include_directories(cmp0022NEW PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/cmp0022>"
)
-cmake_policy(POP)
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmp0022.h"
"${CMAKE_CURRENT_BINARY_DIR}/cmp0022_export.h"
@@ -466,9 +438,6 @@
EXPORT_PROPERTIES EXPORTED_PROPERTY2 EXPORTED_PROPERTY3)
set_property(TARGET cmp0022NEW APPEND PROPERTY INTERFACE_LINK_LIBRARIES testLib2)
-# set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLibIncludeRequired2) # TODO: Test for error
-set_property(TARGET cmp0022OLD APPEND PROPERTY INTERFACE_LINK_LIBRARIES testLib2)
-set_property(TARGET cmp0022OLD APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib3)
add_library(noIncludesInterface empty.cpp)
@@ -622,7 +591,7 @@
testSharedLibWithHelper testSharedLibHelperObj
testExeWithPluginHelper testExePluginHelperObj
testMod1 testMod2
- cmp0022NEW cmp0022OLD
+ cmp0022NEW
TopDirLib SubDirLinkA
systemlib
testInterfaceIncludeUser
@@ -684,7 +653,7 @@
testExe2libImp testLib3Imp testLib3ImpDep subdirlib
testSharedLibRequired testSharedLibRequiredUser testSharedLibRequiredUser2
testSharedLibDepends renamed_on_export
- cmp0022NEW cmp0022OLD
+ cmp0022NEW
TopDirLib SubDirLinkA
systemlib noUses
testInterfaceIncludeUser
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 7d933a4..8b1c11a 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -186,13 +186,9 @@
endforeach()
endif()
-add_executable(cmp0022OLD_test cmp0022OLD_test_vs6_1.cpp)
-target_link_libraries(cmp0022OLD_test bld_cmp0022OLD)
add_executable(cmp0022NEW_test cmp0022NEW_test_vs6_1.cpp)
target_link_libraries(cmp0022NEW_test bld_cmp0022NEW)
-add_executable(cmp0022OLD_exp_test cmp0022OLD_test_vs6_2.cpp)
-target_link_libraries(cmp0022OLD_exp_test exp_cmp0022OLD)
add_executable(cmp0022NEW_exp_test cmp0022NEW_test_vs6_2.cpp)
target_link_libraries(cmp0022NEW_exp_test exp_cmp0022NEW)
@@ -213,10 +209,8 @@
# Export/CMakeLists.txt pretends the RelWithDebInfo (as well as Debug)
# configuration should link to debug libs.
-foreach(c DEBUG RELWITHDEBINFO)
- set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
- set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
-endforeach()
+target_compile_definitions(imp_testExe1 PRIVATE "$<$<CONFIG:Debug,RelWithDebInfo>:EXE_DBG>")
+target_compile_definitions(imp_testExe1b PRIVATE "$<$<CONFIG:Debug,RelWithDebInfo>:EXE_DBG>")
#-----------------------------------------------------------------------------
include(${CMAKE_INSTALL_PREFIX}/lib/expAbs/expAbs.cmake)
@@ -427,32 +421,16 @@
set_property(TARGET iface_test_bld PROPERTY NO_SYSTEM_FROM_IMPORTED 1)
set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY
- LINK_INTERFACE_LIBRARIES
+ INTERFACE_LINK_LIBRARIES
excludedFromAll
)
-get_target_property(_configs bld_testSharedLibRequired IMPORTED_CONFIGURATIONS)
-foreach(_config ${_configs})
- set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY
- IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
- excludedFromAll
- )
-endforeach()
-unset(_configs)
add_executable(iface_test_exp iface_test.cpp)
target_link_libraries(iface_test_exp testSharedLibDepends)
set_property(TARGET testSharedLibDepends APPEND PROPERTY
- LINK_INTERFACE_LIBRARIES
+ INTERFACE_LINK_LIBRARIES
excludedFromAll
)
-get_target_property(_configs testSharedLibDepends IMPORTED_CONFIGURATIONS)
-foreach(_config ${_configs})
- set_property(TARGET testSharedLibDepends APPEND PROPERTY
- IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
- excludedFromAll
- )
-endforeach()
-unset(_configs)
if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4)
OR CMAKE_C_COMPILER_ID MATCHES "LCC"
diff --git a/Tests/ExportImport/Import/A/cmp0022OLD_test.cpp b/Tests/ExportImport/Import/A/cmp0022OLD_test.cpp
deleted file mode 100644
index 9eaaee9..0000000
--- a/Tests/ExportImport/Import/A/cmp0022OLD_test.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-
-#ifdef USING_TESTLIB2
-# error Unexpected USING_TESTLIB2
-#endif
-#ifndef USING_TESTLIB3
-# error Expected USING_TESTLIB3
-#endif
-
-int main(void)
-{
- return 0;
-}
diff --git a/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_1.cpp b/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_1.cpp
deleted file mode 100644
index 90d804c..0000000
--- a/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_1.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "cmp0022OLD_test.cpp"
diff --git a/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_2.cpp b/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_2.cpp
deleted file mode 100644
index 90d804c..0000000
--- a/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_2.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "cmp0022OLD_test.cpp"
diff --git a/Tests/ExportImport/Import/CMakeLists.txt b/Tests/ExportImport/Import/CMakeLists.txt
index f3fff53..fdc07ed 100644
--- a/Tests/ExportImport/Import/CMakeLists.txt
+++ b/Tests/ExportImport/Import/CMakeLists.txt
@@ -1,5 +1,4 @@
cmake_minimum_required (VERSION 3.10)
-cmake_policy(SET CMP0043 OLD)
if(POLICY CMP0129)
cmake_policy(SET CMP0129 NEW)
endif()
diff --git a/Tests/FindPackageCMakeTest/CMakeLists.txt b/Tests/FindPackageCMakeTest/CMakeLists.txt
index 4153437..3e01029 100644
--- a/Tests/FindPackageCMakeTest/CMakeLists.txt
+++ b/Tests/FindPackageCMakeTest/CMakeLists.txt
@@ -12,11 +12,6 @@
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
-# Look for a package which uses FindPackageHandleStandardArgs.cmake with the
-# new (as of cmake 2.8.3) syntax. This works only if CMP0017 is set to NEW,
-# because otherwise FindPackageHandleStandardArgs.cmake from the current
-# directory is included (via CMAKE_MODULE_PATH).
-cmake_policy(SET CMP0017 NEW)
find_package(ZLIB QUIET)
# Look for a package that has a find module and may be found.
diff --git a/Tests/FindRuby/CMakeLists.txt b/Tests/FindRuby/CMakeLists.txt
index ee58923..a6f602c 100644
--- a/Tests/FindRuby/CMakeLists.txt
+++ b/Tests/FindRuby/CMakeLists.txt
@@ -39,7 +39,7 @@
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
set_tests_properties(FindRuby.FailExact PROPERTIES
- PASS_REGULAR_EXPRESSION "Could NOT find Ruby: Found unsuitable version \".*\", but required is.*exact version \"[0-9]+\\.[0-9]+\\.[0-9]+\" \\(found .*\\)")
+ PASS_REGULAR_EXPRESSION "Could NOT find Ruby.*Required[ \n]+is[ \n]+exact[ \n]+version[ \n]+\"1\\.9\\.9\"")
# RVM specific test
if(CMake_TEST_FindRuby_RVM)
diff --git a/Tests/GeneratorExpression/CMP0044/CMakeLists.txt b/Tests/GeneratorExpression/CMP0044/CMakeLists.txt
index 309a8cc..4118042 100644
--- a/Tests/GeneratorExpression/CMP0044/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMP0044/CMakeLists.txt
@@ -7,13 +7,8 @@
endif()
endif()
-if (CMP0044_TYPE)
- cmake_policy(SET CMP0044 ${CMP0044_TYPE})
-endif()
-
-add_library(cmp0044-check-${CMP0044_TYPE} cmp0044-check.cpp)
-target_compile_definitions(cmp0044-check-${CMP0044_TYPE}
+add_library(cmp0044-check cmp0044-check.cpp)
+target_compile_definitions(cmp0044-check
PRIVATE
Result=$<C_COMPILER_ID:${lc_test}>
- Type_Is_${CMP0044_TYPE}
)
diff --git a/Tests/GeneratorExpression/CMP0044/cmp0044-check.cpp b/Tests/GeneratorExpression/CMP0044/cmp0044-check.cpp
index 2812b0d..ad6add9 100644
--- a/Tests/GeneratorExpression/CMP0044/cmp0044-check.cpp
+++ b/Tests/GeneratorExpression/CMP0044/cmp0044-check.cpp
@@ -1,24 +1,5 @@
-
-#ifdef Type_Is_
-# if !Result
-# error Result should be 1 in WARN mode
-# endif
-#endif
-
-#ifdef Type_Is_NEW
-# if Result
-# error Result should be 0 in NEW mode
-# endif
-#endif
-
-#ifdef Type_Is_OLD
-# if !Result
-# error Result should be 1 in OLD mode
-# endif
-#endif
-
-#if !defined(Type_Is_) && !defined(Type_Is_OLD) && !defined(Type_Is_NEW)
-# error No expected definition present
+#if Result
+# error Result should be 0
#endif
void foo(void)
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 708cfc8..4d73bf9 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -438,11 +438,7 @@
set_property(TEST echo-old-style PROPERTY
PASS_REGULAR_EXPRESSION "^\\$<CONFIGURATION>\n$")
-add_subdirectory(CMP0044 ${CMAKE_BINARY_DIR}/CMP0044-WARN)
-set(CMP0044_TYPE NEW)
-add_subdirectory(CMP0044 ${CMAKE_BINARY_DIR}/CMP0044-NEW)
-set(CMP0044_TYPE OLD)
-add_subdirectory(CMP0044 ${CMAKE_BINARY_DIR}/CMP0044-OLD)
+add_subdirectory(CMP0044)
if(NOT CMAKE_GENERATOR STREQUAL Xcode OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
add_library(objlib OBJECT objlib1.c objlib2.c)
@@ -504,5 +500,3 @@
DEPENDS execobjs
)
endif()
-
-cmake_policy(VERSION 2.8.12) # old enough to not set CMP0044
diff --git a/Tests/IncludeDirectories/CMP0021/CMakeLists.txt b/Tests/IncludeDirectories/CMP0021/CMakeLists.txt
deleted file mode 100644
index 0b9aee8..0000000
--- a/Tests/IncludeDirectories/CMP0021/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-
-cmake_policy(SET CMP0021 OLD)
-add_executable(cmp0021exe main.cpp)
-
-if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/includes")
- execute_process(COMMAND ${CMAKE_COMMAND} -E
- copy_directory
- "${CMAKE_CURRENT_SOURCE_DIR}/includes"
- "${CMAKE_CURRENT_BINARY_DIR}/includes"
- )
-endif()
-set_property(TARGET cmp0021exe PROPERTY
- INCLUDE_DIRECTORIES includes/cmp0021)
diff --git a/Tests/IncludeDirectories/CMP0021/includes/cmp0021/cmp0021.h b/Tests/IncludeDirectories/CMP0021/includes/cmp0021/cmp0021.h
deleted file mode 100644
index 3d49b31..0000000
--- a/Tests/IncludeDirectories/CMP0021/includes/cmp0021/cmp0021.h
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#define CMP0021_DEFINE
diff --git a/Tests/IncludeDirectories/CMP0021/main.cpp b/Tests/IncludeDirectories/CMP0021/main.cpp
deleted file mode 100644
index 0f87dd9..0000000
--- a/Tests/IncludeDirectories/CMP0021/main.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "cmp0021.h"
-
-#ifndef CMP0021_DEFINE
-# error Expected CMP0021_DEFINE
-#endif
-
-int main(int, char**)
-{
- return 0;
-}
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index e9c1c63..854a42a 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -206,7 +206,3 @@
if (NOT incs STREQUAL ";/one/two")
message(SEND_ERROR "Empty include_directories entry was not ignored.")
endif()
-
-if(NOT CMAKE_GENERATOR STREQUAL "Xcode" AND NOT CMAKE_GENERATOR MATCHES "Ninja")
- add_subdirectory(CMP0021)
-endif()
diff --git a/Tests/InterfaceLinkLibraries/CMakeLists.txt b/Tests/InterfaceLinkLibraries/CMakeLists.txt
index 5b83b14..7090057 100644
--- a/Tests/InterfaceLinkLibraries/CMakeLists.txt
+++ b/Tests/InterfaceLinkLibraries/CMakeLists.txt
@@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.10)
-cmake_policy(SET CMP0022 NEW)
-
project(InterfaceLinkLibraries)
add_library(foo_shared SHARED foo_vs6_1.cpp)
diff --git a/Tests/LinkDirectory/External/CMakeLists.txt b/Tests/LinkDirectory/External/CMakeLists.txt
index b85e351..d2d3722 100644
--- a/Tests/LinkDirectory/External/CMakeLists.txt
+++ b/Tests/LinkDirectory/External/CMakeLists.txt
@@ -20,13 +20,7 @@
set_property(TARGET myexe3 PROPERTY OUTPUT_NAME LinkDirectory3)
target_link_libraries(myexe3 PRIVATE mylibs)
-
-# Test CMP0015 OLD behavior: -L../lib
-cmake_policy(SET CMP0015 OLD)
link_directories(../lib${cfg_dir})
-
-# Test CMP0015 NEW behavior: -L${CMAKE_CURRENT_SOURCE_DIR}/lib
-cmake_policy(SET CMP0015 NEW)
link_directories(lib${cfg_dir})
add_executable(myexe myexe.c)
diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
deleted file mode 100644
index 11dce36..0000000
--- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(CMAKE_LOADED_COMMANDS)
-
-if (MUDSLIDE_TYPE MATCHES MUCHO)
- add_definitions(-DMUCHO_MUDSLIDE)
-endif ()
-
-include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
-
-add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
-
-if(WATCOM)
- target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib)
-endif()
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
deleted file mode 100644
index ba13727..0000000
--- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
+++ /dev/null
@@ -1,192 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "cmCPluginAPI.h"
-
-typedef struct
-{
- char* LibraryName;
- int Argc;
- char** Argv;
-} cmVTKWrapTclData;
-
-/* do almost everything in the initial pass */
-static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
-{
- char* file;
- char* str;
- const char* srcs;
- const char* cstr;
- char buffer[1024];
- void* source_file;
- char* args[2];
- const char* ccArgs[4];
- const char* ccDep[1];
- const char* ccOut[1];
- cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
-
- cmVTKWrapTclData* cdata =
- (cmVTKWrapTclData*)malloc(sizeof(cmVTKWrapTclData));
- cdata->LibraryName = "BOO";
- cdata->Argc = argc;
- cdata->Argv = argv;
- info->CAPI->SetClientData(info, cdata);
-
- /* Now check and see if the value has been stored in the cache */
- /* already, if so use that value and don't look for the program */
- if (!info->CAPI->IsOn(mf, "TEST_COMMAND_TEST1")) {
- info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
- return 1;
- }
-
- info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
- cdata->LibraryName = "HOO";
-
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON",
- "Test cache variable", CM_CACHE_BOOL);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "",
- "Test cache variable 1", CM_CACHE_PATH);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "",
- "Test cache variable 2", CM_CACHE_FILEPATH);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "",
- "Test cache variable 3", CM_CACHE_STRING);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "",
- "Test cache variable 4", CM_CACHE_INTERNAL);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "",
- "Test cache variable 5", CM_CACHE_STATIC);
-
- file = info->CAPI->ExpandVariablesInString(mf, "${CMAKE_COMMAND}", 0, 0);
-
- str = info->CAPI->GetFilenameWithoutExtension(file);
- info->CAPI->DisplaySatus(mf, str);
- info->CAPI->Free(str);
- str = info->CAPI->GetFilenamePath(file);
- info->CAPI->DisplaySatus(mf, str);
- info->CAPI->Free(str);
- str = info->CAPI->Capitalized("cmake");
- info->CAPI->DisplaySatus(mf, str);
- info->CAPI->Free(str);
-
- info->CAPI->DisplaySatus(mf, info->CAPI->GetProjectName(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeOutputDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetStartDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetStartOutputDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentOutputDirectory(mf));
- snprintf(
- buffer, sizeof(buffer), "Cache version: %d.%d, CMake version: %d.%d",
- info->CAPI->GetCacheMajorVersion(mf), info->CAPI->GetCacheMinorVersion(mf),
- info->CAPI->GetMajorVersion(mf), info->CAPI->GetMinorVersion(mf));
- info->CAPI->DisplaySatus(mf, buffer);
- if (info->CAPI->CommandExists(mf, "SET")) {
- info->CAPI->DisplaySatus(mf, "Command SET exists");
- }
- if (info->CAPI->CommandExists(mf, "SET_FOO_BAR")) {
- info->CAPI->SetError(mf, "Command SET_FOO_BAR should not exists");
- return 0;
- }
- info->CAPI->AddDefineFlag(mf, "-DADDED_DEFINITION");
-
- source_file = info->CAPI->CreateNewSourceFile(mf);
- cstr = info->CAPI->SourceFileGetSourceName(source_file);
- snprintf(buffer, sizeof(buffer), "Should be empty (source file name): [%s]",
- cstr);
- info->CAPI->DisplaySatus(mf, buffer);
- cstr = info->CAPI->SourceFileGetFullPath(source_file);
- snprintf(buffer, sizeof(buffer),
- "Should be empty (source file full path): [%s]", cstr);
- info->CAPI->DisplaySatus(mf, buffer);
- info->CAPI->DefineSourceFileProperty(mf, "SOME_PROPERTY", "unused old prop",
- "This property is no longer used", 0);
- if (info->CAPI->SourceFileGetPropertyAsBool(source_file, "SOME_PROPERTY")) {
- info->CAPI->SetError(mf, "Property SOME_PROPERTY should not be defined");
- return 0;
- }
- info->CAPI->DefineSourceFileProperty(mf, "SOME_PROPERTY2", "nice prop",
- "This property is for testing.", 0);
- info->CAPI->SourceFileSetProperty(source_file, "SOME_PROPERTY2", "HERE");
- cstr = info->CAPI->SourceFileGetProperty(source_file, "ABSTRACT");
- snprintf(buffer, sizeof(buffer),
- "Should be 0 (source file abstract property): [%p]", cstr);
- info->CAPI->DisplaySatus(mf, buffer);
-
- info->CAPI->DestroySourceFile(source_file);
-
- srcs = argv[2];
- info->CAPI->AddExecutable(mf, "LoadedCommand", 1, &srcs, 0);
-
- /* add customs commands to generate the source file */
- ccArgs[0] = "-E";
- ccArgs[1] = "copy";
- ccArgs[2] = argv[0];
- ccArgs[3] = argv[1];
- ccDep[0] = ccArgs[2];
- ccOut[0] = ccArgs[3];
- info->CAPI->AddCustomCommand(mf, "LoadedCommand.cxx.in", file, 4, ccArgs, 1,
- ccDep, 1, ccOut, "LoadedCommand");
-
- ccArgs[2] = argv[1];
- ccArgs[3] = argv[2];
- ccDep[0] = ccArgs[2];
- ccOut[0] = ccArgs[3];
- info->CAPI->AddCustomCommandToOutput(mf, ccOut[0], file, 4, ccArgs, ccDep[0],
- 0, 0);
-
- ccArgs[1] = "echo";
- ccArgs[2] = "Build has finished";
- info->CAPI->AddCustomCommandToTarget(mf, "LoadedCommand", file, 3, ccArgs,
- CM_POST_BUILD);
-
- info->CAPI->Free(file);
-
- args[0] = "TEST_EXEC";
- args[1] = "TRUE";
-
- /* code coverage */
- if (info->CAPI->GetTotalArgumentSize(2, args) != 13) {
- return 0;
- }
-
- ccArgs[0] = "TEST_EXEC";
- ccArgs[1] = "TRUE";
- info->CAPI->ExecuteCommand(mf, "SET", 2, ccArgs);
-
- /* make sure we can find the source file */
- if (!info->CAPI->GetSource(mf, argv[1])) {
- info->CAPI->SetError(mf, "Source file could not be found!");
- return 0;
- }
-
- return 1;
-}
-
-static void CCONV FinalPass(void* inf, void* mf)
-{
- cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
- /* get our client data from initial pass */
- cmVTKWrapTclData* cdata = (cmVTKWrapTclData*)info->CAPI->GetClientData(info);
- if (strcmp(info->CAPI->GetDefinition(mf, "TEST_DEF"), "HOO") ||
- strcmp(cdata->LibraryName, "HOO")) {
- fprintf(stderr, "*** Failed LOADED COMMAND Final Pass\n");
- }
-}
-static void CCONV Destructor(void* inf)
-{
- cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
- /* get our client data from initial pass */
- cmVTKWrapTclData* cdata = (cmVTKWrapTclData*)info->CAPI->GetClientData(info);
- free(cdata);
-}
-
-#ifdef MUCHO_MUDSLIDE
-void CM_PLUGIN_EXPORT CCONV CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo* info)
-{
- info->InitialPass = InitialPass;
- info->FinalPass = FinalPass;
- info->Destructor = Destructor;
- info->m_Inherited = 0;
- info->Name = "CMAKE_TEST_COMMAND";
-}
-#endif
diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt
deleted file mode 100644
index 891b534..0000000
--- a/Tests/LoadCommand/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-cmake_policy(SET CMP0031 OLD) # testing the old behavior
-project(LoadCommand)
-
-# set a definition
-set (TEST_COMMAND_TEST1 1)
-
-include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
-CHECK_TYPE_SIZE(char SIZEOF_CHAR)
-CHECK_TYPE_SIZE(short SIZEOF_SHORT)
-
-configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in
- ${LoadCommand_BINARY_DIR}/LoadedCommand.h)
-
-include_directories(${LoadCommand_BINARY_DIR})
-
-# try to compile the command
-# make sure it is not already loaded
-if(COMMAND CMAKE_TEST_COMMAND)
-else()
- try_compile(COMPILE_OK
- ${LoadCommand_BINARY_DIR}/CMakeCommands
- ${LoadCommand_SOURCE_DIR}/CMakeCommands
- CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
- OUTPUT_VARIABLE OUTPUT )
-endif()
-
-message("Output from try compile: ${OUTPUT}")
-
-# if the compile was OK, try loading the command
-if (COMPILE_OK)
- load_command(CMAKE_TEST_COMMAND
- ${LoadCommand_BINARY_DIR}/CMakeCommands
- ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug
- ${LoadCommand_BINARY_DIR}/CMakeCommands/Development
- )
- # if the command loaded, execute the command
- if (COMMAND CMAKE_TEST_COMMAND)
- CMAKE_TEST_COMMAND(
- "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in"
- "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in"
- "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx"
- )
- endif ()
-else ()
- message("failed to compile CMAKE_LOADED_COMMANDS")
-endif ()
-
-# TEST_DEF is set by the loaded command cmTestCommand.c
-if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
- add_definitions(-DCMAKE_IS_FUN)
-endif ()
diff --git a/Tests/LoadCommand/LoadedCommand.cxx.in b/Tests/LoadCommand/LoadedCommand.cxx.in
deleted file mode 100644
index 72ec014..0000000
--- a/Tests/LoadCommand/LoadedCommand.cxx.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "LoadedCommand.h"
-#include <stdio.h>
-
-int testSizeOf(int s1, int s2)
-{
- return s1 - s2;
-}
-
-int main ()
-{
- int ret = 0;
-
-#if !defined( ADDED_DEFINITION )
- printf("Should have ADDED_DEFINITION defined\n");
- ret= 1;
-#endif
-#if !defined(CMAKE_IS_FUN)
- printf("Loaded Command was not built with CMAKE_IS_FUN: failed.\n");
- ret = 1;
-#endif
- if(testSizeOf(SIZEOF_CHAR, sizeof(char)))
- {
- printf("Size of char is broken.\n");
- ret = 1;
- }
- if(testSizeOf(SIZEOF_SHORT, sizeof(short)))
- {
- printf("Size of short is broken.\n");
- ret = 1;
- }
- return ret;
-}
diff --git a/Tests/LoadCommand/LoadedCommand.h.in b/Tests/LoadCommand/LoadedCommand.h.in
deleted file mode 100644
index 733c414..0000000
--- a/Tests/LoadCommand/LoadedCommand.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Check for size of types */
-#cmakedefine SIZEOF_CHAR ${SIZEOF_CHAR}
-#cmakedefine SIZEOF_SHORT ${SIZEOF_SHORT}
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
deleted file mode 100644
index 9f29c43..0000000
--- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(CMAKE_LOADED_COMMANDS)
-
-if (MUDSLIDE_TYPE MATCHES MUCHO)
- add_definitions(-DMUCHO_MUDSLIDE)
-endif ()
-
-if(WATCOM)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
-endif()
-include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
-
-add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
-
-if(WATCOM)
- target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib)
-endif()
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
deleted file mode 100644
index e3b332c..0000000
--- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
+++ /dev/null
@@ -1,192 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "cmCPluginAPI.h"
-
-typedef struct
-{
- char* LibraryName;
- int Argc;
- char** Argv;
-} cmVTKWrapTclData;
-
-/* do almost everything in the initial pass */
-static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
-{
- char* file;
- char* str;
- const char* srcs;
- char* cstr;
- char buffer[1024];
- void* source_file;
- char* args[2];
- const char* ccArgs[4];
- const char* ccDep[1];
- const char* ccOut[1];
- cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
-
- cmVTKWrapTclData* cdata =
- (cmVTKWrapTclData*)malloc(sizeof(cmVTKWrapTclData));
- cdata->LibraryName = "BOO";
- cdata->Argc = argc;
- cdata->Argv = argv;
- info->CAPI->SetClientData(info, cdata);
-
- /* Now check and see if the value has been stored in the cache */
- /* already, if so use that value and don't look for the program */
- if (!info->CAPI->IsOn(mf, "TEST_COMMAND_TEST1")) {
- info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
- return 1;
- }
-
- info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
- cdata->LibraryName = "HOO";
-
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON",
- "Test cache variable", CM_CACHE_BOOL);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "",
- "Test cache variable 1", CM_CACHE_PATH);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "",
- "Test cache variable 2", CM_CACHE_FILEPATH);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "",
- "Test cache variable 3", CM_CACHE_STRING);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "",
- "Test cache variable 4", CM_CACHE_INTERNAL);
- info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "",
- "Test cache variable 5", CM_CACHE_STATIC);
-
- file = info->CAPI->ExpandVariablesInString(mf, "${CMAKE_COMMAND}", 0, 0);
-
- str = info->CAPI->GetFilenameWithoutExtension(file);
- info->CAPI->DisplaySatus(mf, str);
- info->CAPI->Free(str);
- str = info->CAPI->GetFilenamePath(file);
- info->CAPI->DisplaySatus(mf, str);
- info->CAPI->Free(str);
- str = info->CAPI->Capitalized("cmake");
- info->CAPI->DisplaySatus(mf, str);
- info->CAPI->Free(str);
-
- info->CAPI->DisplaySatus(mf, info->CAPI->GetProjectName(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeOutputDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetStartDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetStartOutputDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentDirectory(mf));
- info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentOutputDirectory(mf));
- snprintf(
- buffer, sizeof(buffer), "Cache version: %d.%d, CMake version: %d.%d",
- info->CAPI->GetCacheMajorVersion(mf), info->CAPI->GetCacheMinorVersion(mf),
- info->CAPI->GetMajorVersion(mf), info->CAPI->GetMinorVersion(mf));
- info->CAPI->DisplaySatus(mf, buffer);
- if (info->CAPI->CommandExists(mf, "SET")) {
- info->CAPI->DisplaySatus(mf, "Command SET exists");
- }
- if (info->CAPI->CommandExists(mf, "SET_FOO_BAR")) {
- info->CAPI->SetError(mf, "Command SET_FOO_BAR should not exists");
- return 0;
- }
- info->CAPI->AddDefineFlag(mf, "-DADDED_DEFINITION");
-
- source_file = info->CAPI->CreateNewSourceFile(mf);
- cstr = info->CAPI->SourceFileGetSourceName(source_file);
- snprintf(buffer, sizeof(buffer), "Should be empty (source file name): [%s]",
- cstr);
- info->CAPI->DisplaySatus(mf, buffer);
- cstr = info->CAPI->SourceFileGetFullPath(source_file);
- snprintf(buffer, sizeof(buffer),
- "Should be empty (source file full path): [%s]", cstr);
- info->CAPI->DisplaySatus(mf, buffer);
- info->CAPI->DefineSourceFileProperty(mf, "SOME_PROPERTY", "unused old prop",
- "This property is no longer used", 0);
- if (info->CAPI->SourceFileGetPropertyAsBool(source_file, "SOME_PROPERTY")) {
- info->CAPI->SetError(mf, "Property SOME_PROPERTY should not be defined");
- return 0;
- }
- info->CAPI->DefineSourceFileProperty(mf, "SOME_PROPERTY2", "nice prop",
- "This property is for testing.", 0);
- info->CAPI->SourceFileSetProperty(source_file, "SOME_PROPERTY2", "HERE");
- cstr = info->CAPI->SourceFileGetProperty(source_file, "ABSTRACT");
- snprintf(buffer, sizeof(buffer),
- "Should be 0 (source file abstract property): [%p]", cstr);
- info->CAPI->DisplaySatus(mf, buffer);
-
- info->CAPI->DestroySourceFile(source_file);
-
- srcs = argv[2];
- info->CAPI->AddExecutable(mf, "LoadedCommand", 1, &srcs, 0);
-
- /* add customs commands to generate the source file */
- ccArgs[0] = "-E";
- ccArgs[1] = "copy";
- ccArgs[2] = argv[0];
- ccArgs[3] = argv[1];
- ccDep[0] = ccArgs[2];
- ccOut[0] = ccArgs[3];
- info->CAPI->AddCustomCommand(mf, "LoadedCommand.cxx.in", file, 4, ccArgs, 1,
- ccDep, 1, ccOut, "LoadedCommand");
-
- ccArgs[2] = argv[1];
- ccArgs[3] = argv[2];
- ccDep[0] = ccArgs[2];
- ccOut[0] = ccArgs[3];
- info->CAPI->AddCustomCommandToOutput(mf, ccOut[0], file, 4, ccArgs, ccDep[0],
- 0, 0);
-
- ccArgs[1] = "echo";
- ccArgs[2] = "Build has finished";
- info->CAPI->AddCustomCommandToTarget(mf, "LoadedCommand", file, 3, ccArgs,
- CM_POST_BUILD);
-
- info->CAPI->Free(file);
-
- args[0] = "TEST_EXEC";
- args[1] = "TRUE";
-
- /* code coverage */
- if (info->CAPI->GetTotalArgumentSize(2, args) != 13) {
- return 0;
- }
-
- ccArgs[0] = "TEST_EXEC";
- ccArgs[1] = "TRUE";
- info->CAPI->ExecuteCommand(mf, "SET", 2, ccArgs);
-
- /* make sure we can find the source file */
- if (!info->CAPI->GetSource(mf, argv[1])) {
- info->CAPI->SetError(mf, "Source file could not be found!");
- return 0;
- }
-
- return 1;
-}
-
-static void CCONV FinalPass(void* inf, void* mf)
-{
- cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
- /* get our client data from initial pass */
- cmVTKWrapTclData* cdata = (cmVTKWrapTclData*)info->CAPI->GetClientData(info);
- if (strcmp(info->CAPI->GetDefinition(mf, "TEST_DEF"), "HOO") ||
- strcmp(cdata->LibraryName, "HOO")) {
- fprintf(stderr, "*** Failed LOADED COMMAND Final Pass\n");
- }
-}
-static void CCONV Destructor(void* inf)
-{
- cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
- /* get our client data from initial pass */
- cmVTKWrapTclData* cdata = (cmVTKWrapTclData*)info->CAPI->GetClientData(info);
- free(cdata);
-}
-
-#ifdef MUCHO_MUDSLIDE
-void CM_PLUGIN_EXPORT CCONV CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo* info)
-{
- info->InitialPass = InitialPass;
- info->FinalPass = FinalPass;
- info->Destructor = Destructor;
- info->m_Inherited = 0;
- info->Name = "CMAKE_TEST_COMMAND";
-}
-#endif
diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt
deleted file mode 100644
index ff68ae6..0000000
--- a/Tests/LoadCommandOneConfig/CMakeLists.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-cmake_policy(SET CMP0031 OLD) # testing the old behavior
-project(LoadCommand)
-
-# set a definition
-set (TEST_COMMAND_TEST1 1)
-
-include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
-CHECK_TYPE_SIZE(char SIZEOF_CHAR)
-CHECK_TYPE_SIZE(short SIZEOF_SHORT)
-
-include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
-CHECK_INCLUDE_FILE("sys/prctl.h" HAVE_SYS_PRCTL_H)
-
-include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
-CHECK_LIBRARY_EXISTS(m ceil "" HAVE_LIBM)
-
-configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in
- ${LoadCommand_BINARY_DIR}/LoadedCommand.h)
-
-include_directories(${LoadCommand_BINARY_DIR})
-
-# try to compile the command
-# make sure it is not already loaded
-if(COMMAND CMAKE_TEST_COMMAND)
-else()
- try_compile(COMPILE_OK
- ${LoadCommand_BINARY_DIR}/CMakeCommands
- ${LoadCommand_SOURCE_DIR}/CMakeCommands
- CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
- OUTPUT_VARIABLE OUTPUT )
-endif()
-
-message("Output from try compile: ${OUTPUT}")
-
-# if the compile was OK, try loading the command
-if (COMPILE_OK)
- load_command(CMAKE_TEST_COMMAND
- ${LoadCommand_BINARY_DIR}/CMakeCommands
- ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug
- ${LoadCommand_BINARY_DIR}/CMakeCommands/Development
- )
- # if the command loaded, execute the command
- if (COMMAND CMAKE_TEST_COMMAND)
- CMAKE_TEST_COMMAND(
- "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in"
- "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in"
- "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx"
- )
- endif ()
-else ()
- message("failed to compile CMAKE_LOADED_COMMANDS")
-endif ()
-
-# TEST_DEF is set by the loaded command cmTestCommand.c
-if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
- add_definitions(-DCMAKE_IS_FUN)
-endif ()
diff --git a/Tests/LoadCommandOneConfig/LoadedCommand.cxx.in b/Tests/LoadCommandOneConfig/LoadedCommand.cxx.in
deleted file mode 100644
index 72ec014..0000000
--- a/Tests/LoadCommandOneConfig/LoadedCommand.cxx.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "LoadedCommand.h"
-#include <stdio.h>
-
-int testSizeOf(int s1, int s2)
-{
- return s1 - s2;
-}
-
-int main ()
-{
- int ret = 0;
-
-#if !defined( ADDED_DEFINITION )
- printf("Should have ADDED_DEFINITION defined\n");
- ret= 1;
-#endif
-#if !defined(CMAKE_IS_FUN)
- printf("Loaded Command was not built with CMAKE_IS_FUN: failed.\n");
- ret = 1;
-#endif
- if(testSizeOf(SIZEOF_CHAR, sizeof(char)))
- {
- printf("Size of char is broken.\n");
- ret = 1;
- }
- if(testSizeOf(SIZEOF_SHORT, sizeof(short)))
- {
- printf("Size of short is broken.\n");
- ret = 1;
- }
- return ret;
-}
diff --git a/Tests/LoadCommandOneConfig/LoadedCommand.h.in b/Tests/LoadCommandOneConfig/LoadedCommand.h.in
deleted file mode 100644
index d748d06..0000000
--- a/Tests/LoadCommandOneConfig/LoadedCommand.h.in
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Check for size of types */
-#cmakedefine SIZEOF_CHAR ${SIZEOF_CHAR}
-#cmakedefine SIZEOF_SHORT ${SIZEOF_SHORT}
-
-/* Check for headers */
-#cmakedefine HAVE_SYS_PRCTL_H
-
-/* Check for libraries */
-#cmakedefine HAVE_LIBM
diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt
index 50ac71f..5f32953 100644
--- a/Tests/MacRuntimePath/A/CMakeLists.txt
+++ b/Tests/MacRuntimePath/A/CMakeLists.txt
@@ -10,8 +10,6 @@
set_target_properties(shared2 PROPERTIES
BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath")
-cmake_policy(SET CMP0042 NEW)
-
# a framework library
add_library(framework SHARED framework.cpp framework.h)
set_target_properties(framework PROPERTIES FRAMEWORK 1)
diff --git a/Tests/Policy0002/A/CMakeLists.txt b/Tests/Policy0002/A/CMakeLists.txt
deleted file mode 100644
index cee6422..0000000
--- a/Tests/Policy0002/A/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_executable(Policy0002 ../policy0002.c)
diff --git a/Tests/Policy0002/CMakeLists.txt b/Tests/Policy0002/CMakeLists.txt
deleted file mode 100644
index a408e76..0000000
--- a/Tests/Policy0002/CMakeLists.txt
+++ /dev/null
@@ -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)
diff --git a/Tests/Policy0002/policy0002.c b/Tests/Policy0002/policy0002.c
deleted file mode 100644
index 8488f4e..0000000
--- a/Tests/Policy0002/policy0002.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int main(void)
-{
- return 0;
-}
diff --git a/Tests/PolicyScope/Bar.cmake b/Tests/PolicyScope/Bar.cmake
index f15124f..fb5ef60 100644
--- a/Tests/PolicyScope/Bar.cmake
+++ b/Tests/PolicyScope/Bar.cmake
@@ -3,6 +3,3 @@
# 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)
diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt
index 36ba01a..15e553c 100644
--- a/Tests/PolicyScope/CMakeLists.txt
+++ b/Tests/PolicyScope/CMakeLists.txt
@@ -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 @@
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)
diff --git a/Tests/PolicyScope/FindFoo.cmake b/Tests/PolicyScope/FindFoo.cmake
deleted file mode 100644
index 843c650..0000000
--- a/Tests/PolicyScope/FindFoo.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_minimum_required(VERSION 3.31)
-cmake_policy(SET CMP0180 OLD)
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 3fd2100..a7d65ba 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -1,6 +1,4 @@
cmake_minimum_required(VERSION 3.10)
-cmake_policy(SET CMP0043 OLD) # testing the old behavior
-
project(Preprocess)
# This test is meant both as a test and as a reference for supported
@@ -229,24 +227,45 @@
set(TARGET_PATH "${Preprocess_SOURCE_DIR}/target_def.h")
# Set some definition properties.
-foreach(c "" "_DEBUG" "_RELEASE" "_RELWITHDEBINFO" "_MINSIZEREL")
- set(FLAVOR "${c}")
+set_property(
+ DIRECTORY .
+ APPEND PROPERTY COMPILE_DEFINITIONS "DIRECTORY_DEF"
+ )
+set_property(
+ TARGET Preprocess
+ APPEND PROPERTY COMPILE_DEFINITIONS "TARGET_DEF"
+ )
+set_property(
+ SOURCE preprocess.c preprocess.cxx
+ PROPERTY COMPILE_DEFINITIONS "FILE_DEF"
+ )
+
+# Set some per-config definition properties.
+foreach(c "DEBUG" "RELEASE" "RELWITHDEBINFO" "MINSIZEREL")
# Treat RelWithDebInfo and MinSizeRel as Release to avoid having
# an exponential matrix of inclusions and exclusions of defines
- if("${c}" STREQUAL "_RELWITHDEBINFO" OR "${c}" STREQUAL "_MINSIZEREL")
- set(FLAVOR "_RELEASE")
+ if("${c}" STREQUAL "RELWITHDEBINFO" OR "${c}" STREQUAL "MINSIZEREL")
+ set(FLAVOR "RELEASE")
+ else()
+ set(FLAVOR "${c}")
endif()
set_property(
DIRECTORY .
- APPEND PROPERTY COMPILE_DEFINITIONS${c} "DIRECTORY_DEF${FLAVOR}"
+ APPEND PROPERTY COMPILE_DEFINITIONS "$<$<CONFIG:${c}>:DIRECTORY_DEF_${FLAVOR}>"
)
set_property(
TARGET Preprocess
- PROPERTY COMPILE_DEFINITIONS${c} "TARGET_DEF${FLAVOR}"
+ APPEND PROPERTY COMPILE_DEFINITIONS "$<$<CONFIG:${c}>:TARGET_DEF_${FLAVOR}>"
)
+ if(NOT PREPROCESS_XCODE)
+ set_property(
+ SOURCE preprocess.c
+ APPEND PROPERTY COMPILE_DEFINITIONS "$<$<CONFIG:${c}>:FILE_DEF_${FLAVOR}>"
+ )
+ endif()
set_property(
- SOURCE preprocess.c preprocess.cxx
- PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${FLAVOR}"
+ SOURCE preprocess.cxx
+ PROPERTY COMPILE_DEFINITIONS_${c} "FILE_DEF_${FLAVOR}"
)
endforeach()
diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt
index 47a6408..6d5e34b 100644
--- a/Tests/Qt4Targets/CMakeLists.txt
+++ b/Tests/Qt4Targets/CMakeLists.txt
@@ -2,8 +2,6 @@
project(Qt4Targets)
-cmake_policy(SET CMP0020 NEW)
-
find_package(Qt4 REQUIRED)
set(CMAKE_AUTOMOC ON)
diff --git a/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake b/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake
index 28c175d..110a61c 100644
--- a/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake
+++ b/Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake
@@ -25,7 +25,6 @@
endif()\n\n")
string (APPEND GENERATE_CONTENT [[
-cmake_policy (SET CMP0011 NEW)
cmake_policy (SET CMP0057 NEW)
macro (CHECK_FILE test_msg path)
diff --git a/Tests/RunCMake/CMP0004/CMP0004-OLD-result.txt b/Tests/RunCMake/CMP0004/CMP0004-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/CMP0004/CMP0004-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/CMP0004/CMP0004-OLD-stderr.txt b/Tests/RunCMake/CMP0004/CMP0004-OLD-stderr.txt
deleted file mode 100644
index 782e45c..0000000
--- a/Tests/RunCMake/CMP0004/CMP0004-OLD-stderr.txt
+++ /dev/null
@@ -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.
diff --git a/Tests/RunCMake/CMP0004/CMP0004-OLD.cmake b/Tests/RunCMake/CMP0004/CMP0004-OLD.cmake
deleted file mode 100644
index 32c1474..0000000
--- a/Tests/RunCMake/CMP0004/CMP0004-OLD.cmake
+++ /dev/null
@@ -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 >")
diff --git a/Tests/RunCMake/CMP0004/RunCMakeTest.cmake b/Tests/RunCMake/CMP0004/RunCMakeTest.cmake
index 950d0ed..8e3079c 100644
--- a/Tests/RunCMake/CMP0004/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0004/RunCMakeTest.cmake
@@ -1,5 +1,4 @@
include(RunCMake)
-run_cmake(CMP0004-OLD)
run_cmake(CMP0004-NEW)
run_cmake(CMP0004-policy-genex)
diff --git a/Tests/RunCMake/CMP0019/CMP0019-NEW.cmake b/Tests/RunCMake/CMP0019/CMP0019-NEW.cmake
index 3091e66..a419f30 100644
--- a/Tests/RunCMake/CMP0019/CMP0019-NEW.cmake
+++ b/Tests/RunCMake/CMP0019/CMP0019-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0019 NEW)
include(CMP0019-code.cmake)
diff --git a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
deleted file mode 100644
index dc03414..0000000
--- a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0019-OLD\.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0019 will be removed from a future version
- of CMake\.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0019/CMP0019-OLD.cmake b/Tests/RunCMake/CMP0019/CMP0019-OLD.cmake
deleted file mode 100644
index 0f02f9c..0000000
--- a/Tests/RunCMake/CMP0019/CMP0019-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0019 OLD)
-include(CMP0019-code.cmake)
diff --git a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
deleted file mode 100644
index 6eee437..0000000
--- a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-^CMake Warning \(dev\) in CMakeLists\.txt:
- Policy CMP0019 is not set: Do not re-expand variables in include and link
- information. Run "cmake --help-policy CMP0019" for policy details. Use
- the cmake_policy command to set the policy and suppress this warning.
-
- The following variable evaluations were encountered:
-
- Evaluated directory INCLUDE_DIRECTORIES
-
- /usr/include/\${VAR_INCLUDE};/usr/include/normal
-
- as
-
- /usr/include/VAL_INCLUDE;/usr/include/normal
-
- Evaluated target some_target INCLUDE_DIRECTORIES
-
- /usr/include/\${VAR_INCLUDE};/usr/include/normal
-
- as
-
- /usr/include/VAL_INCLUDE;/usr/include/normal
-
- Evaluated link directories
-
- /usr/lib/\${VAR_LINK_DIRS};/usr/lib/normal
-
- as
-
- /usr/lib/VAL_LINK_DIRS;/usr/lib/normal
-
- Evaluated link library
-
- \${VAR_LINK_LIBS}
-
- as
-
- VAL_LINK_LIBS
-
-This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0019/CMP0019-WARN.cmake b/Tests/RunCMake/CMP0019/CMP0019-WARN.cmake
deleted file mode 100644
index a419f30..0000000
--- a/Tests/RunCMake/CMP0019/CMP0019-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include(CMP0019-code.cmake)
diff --git a/Tests/RunCMake/CMP0019/CMakeLists.txt b/Tests/RunCMake/CMP0019/CMakeLists.txt
index 129b75c..bf2ef15 100644
--- a/Tests/RunCMake/CMP0019/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0019/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.10)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
-include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0019/RunCMakeTest.cmake b/Tests/RunCMake/CMP0019/RunCMakeTest.cmake
index fcd080f..a6b4527 100644
--- a/Tests/RunCMake/CMP0019/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0019/RunCMakeTest.cmake
@@ -1,6 +1,3 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0019-WARN)
-run_cmake(CMP0019-OLD)
run_cmake(CMP0019-NEW)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake
deleted file mode 100644
index b0268c8..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-enable_language(CXX)
-
-add_library(testLib empty_vs6_1.cpp)
-add_executable(testExe empty_vs6_2.cpp)
-target_link_libraries(testExe testLib)
-
-export(TARGETS testExe FILE "${CMAKE_CURRENT_BINARY_DIR}/cmp0022NOWARN-exe.cmake")
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake
index 2e76ee0..57c3ed0 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake
@@ -1,7 +1,5 @@
enable_language(CXX)
-cmake_policy(SET CMP0042 NEW)
-
add_library(foo SHARED empty_vs6_1.cpp)
add_library(bar SHARED empty_vs6_2.cpp)
target_link_libraries(bar foo)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW.cmake
index 308980c..8ad1687 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW.cmake
@@ -1,8 +1,6 @@
enable_language(CXX)
-cmake_policy(SET CMP0022 NEW)
-
add_library(foo STATIC empty_vs6_1.cpp)
add_library(bar STATIC empty_vs6_2.cpp)
add_library(bat STATIC empty_vs6_3.cpp)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt
deleted file mode 100644
index c84a289..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-^CMake Warning \(dev\) in CMakeLists\.txt:
- Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
- interface. Run "cmake --help-policy CMP0022" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "bar" has an INTERFACE_LINK_LIBRARIES property. This should be
- preferred as the source of the link interface for this library but because
- CMP0022 is not set CMake is ignoring the property and using the link
- implementation as the link interface instead.
-
- INTERFACE_LINK_LIBRARIES:
-
- foo
-
- Link implementation:
-
- \(empty\)
-
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake
deleted file mode 100644
index 7356e29..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-
-enable_language(CXX)
-
-add_library(foo SHARED empty_vs6_1.cpp)
-add_library(bar SHARED empty_vs6_2.cpp)
-
-set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo)
-
-add_library(user empty.cpp)
-target_link_libraries(user bar)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt
deleted file mode 100644
index 1370c5e..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-CMake Warning \(dev\) in CMakeLists.txt:
- Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
- interface. Run "cmake --help-policy CMP0022" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "bar" has an INTERFACE_LINK_LIBRARIES property. This should be
- preferred as the source of the link interface for this library but because
- CMP0022 is not set CMake is ignoring the property and using the link
- implementation as the link interface instead.
-
- INTERFACE_LINK_LIBRARIES:
-
- foo
-
- Link implementation:
-
- bat
-
-This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake
deleted file mode 100644
index 0ea4fe5..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-
-enable_language(CXX)
-
-add_library(foo STATIC empty_vs6_1.cpp)
-add_library(bar STATIC empty_vs6_2.cpp)
-add_library(bat STATIC empty_vs6_3.cpp)
-set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo)
-set_property(TARGET bar PROPERTY LINK_LIBRARIES bat)
-
-add_library(user empty.cpp)
-target_link_libraries(user bar)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
deleted file mode 100644
index 39a9511..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-^CMake Warning \(dev\) in CMakeLists\.txt:
- Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
- interface. Run "cmake --help-policy CMP0022" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from
- its LINK_INTERFACE_LIBRARIES properties.
-
- INTERFACE_LINK_LIBRARIES:
-
- foo
-
- LINK_INTERFACE_LIBRARIES:
-
- bat
-
-This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt
deleted file mode 100644
index 5d39214..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-CMake Warning \(dev\) in CMakeLists.txt:
- Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
- interface. Run "cmake --help-policy CMP0022" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from
- its LINK_INTERFACE_LIBRARIES(_DEBUG)? properties.
-
- INTERFACE_LINK_LIBRARIES:
-
- foo
-
- LINK_INTERFACE_LIBRARIES(_DEBUG)?:
-
- bat
-
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake
deleted file mode 100644
index ba207db..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-
-enable_language(CXX)
-
-add_library(foo SHARED empty_vs6_1.cpp)
-add_library(bar SHARED empty_vs6_2.cpp)
-add_library(bat SHARED empty_vs6_3.cpp)
-target_link_libraries(bar LINK_PUBLIC foo)
-# Replace the compatibility values set by target_link_libraries
-set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat)
-set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES_DEBUG bat)
-
-add_library(user SHARED empty.cpp)
-target_link_libraries(user bar)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
deleted file mode 100644
index 38adcca..0000000
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-
-enable_language(CXX)
-
-cmake_policy(SET CMP0042 NEW)
-
-add_library(foo SHARED empty_vs6_1.cpp)
-add_library(bar SHARED empty_vs6_2.cpp)
-add_library(bat SHARED empty_vs6_3.cpp)
-set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo)
-set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat)
-
-add_library(user empty.cpp)
-target_link_libraries(user bar)
-
-# Use "bar" again with a different "head" target to check
-# that the warning does not appear again.
-add_library(user2 empty_vs6_3.cpp)
-target_link_libraries(user2 bar)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-exe.cmake b/Tests/RunCMake/CMP0022/CMP0022-export-exe.cmake
index d832fac..70dc6fa 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-export-exe.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-export-exe.cmake
@@ -1,7 +1,5 @@
enable_language(CXX)
-cmake_policy(SET CMP0022 NEW)
-
add_library(testLib empty_vs6_1.cpp)
add_executable(testExe empty_vs6_2.cpp)
target_link_libraries(testExe testLib)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-export.cmake
index e121b53..5a61a89 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-export.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-export.cmake
@@ -1,8 +1,6 @@
enable_language(CXX)
-cmake_policy(SET CMP0022 NEW)
-
add_library(cmp0022NEW SHARED empty_vs6_1.cpp)
add_library(testLib SHARED empty_vs6_2.cpp)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake
index 532e204..f9eca04 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake
@@ -1,8 +1,6 @@
enable_language(CXX)
-cmake_policy(SET CMP0022 NEW)
-
add_library(cmp0022NEW SHARED empty_vs6_1.cpp)
add_library(testLib SHARED empty_vs6_2.cpp)
diff --git a/Tests/RunCMake/CMP0022/CMakeLists.txt b/Tests/RunCMake/CMP0022/CMakeLists.txt
index 72abfc8..bf2ef15 100644
--- a/Tests/RunCMake/CMP0022/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0022/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
index ea956fc..4af82d0 100644
--- a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
@@ -1,11 +1,5 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0022-WARN)
-run_cmake(CMP0022-WARN-tll)
-run_cmake(CMP0022-WARN-static)
-run_cmake(CMP0022-WARN-empty-old)
-run_cmake(CMP0022-NOWARN-exe)
run_cmake(CMP0022-NOWARN-shared)
run_cmake(CMP0022-NOWARN-static)
run_cmake(CMP0022-NOWARN-static-NEW)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-result.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
deleted file mode 100644
index 84dec32..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0026-CONFIG-LOCATION-OLD.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0026 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD.cmake b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD.cmake
deleted file mode 100644
index 4166828..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-enable_language(CXX)
-
-cmake_policy(SET CMP0026 OLD)
-
-add_library(somelib empty.cpp)
-get_target_property(_loc somelib Debug_LOCATION)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-result.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt
deleted file mode 100644
index d2209fd..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0026-CONFIG-LOCATION-WARN.cmake:5 \(get_target_property\):
- Policy CMP0026 is not set: Disallow use of the LOCATION target property.
- Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The LOCATION property should not be read from target "somelib". Use the
- target name directly with add_custom_command, or use the generator
- expression \$<TARGET_FILE>, as appropriate.
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN.cmake b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN.cmake
deleted file mode 100644
index 511056f..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-enable_language(CXX)
-
-add_library(somelib empty.cpp)
-get_target_property(_loc somelib Debug_LOCATION)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-result.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
deleted file mode 100644
index 1fb4ef6..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0026-LOCATION-CONFIG-OLD.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0026 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD.cmake b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD.cmake
deleted file mode 100644
index 482373d..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-enable_language(CXX)
-
-cmake_policy(SET CMP0026 OLD)
-
-add_library(somelib empty.cpp)
-get_target_property(_loc somelib LOCATION_Debug)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-result.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt
deleted file mode 100644
index 8b4faf0..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0026-LOCATION-CONFIG-WARN.cmake:5 \(get_target_property\):
- Policy CMP0026 is not set: Disallow use of the LOCATION target property.
- Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The LOCATION property should not be read from target "somelib". Use the
- target name directly with add_custom_command, or use the generator
- expression \$<TARGET_FILE>, as appropriate.
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN.cmake b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN.cmake
deleted file mode 100644
index 85711c3..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-enable_language(CXX)
-
-add_library(somelib empty.cpp)
-get_target_property(_loc somelib LOCATION_Debug)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
deleted file mode 100644
index b4282f5..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0026-OLD.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0026 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake b/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake
deleted file mode 100644
index 80497a3..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-enable_language(CXX)
-
-cmake_policy(SET CMP0026 OLD)
-
-set(out ${CMAKE_CURRENT_BINARY_DIR}/out.txt)
-
-add_library(somelib empty.cpp ${out})
-get_target_property(_loc somelib LOCATION)
-
-file(WRITE "${out}"
- "source file written by project code after getting target LOCATION\n"
- )
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt
deleted file mode 100644
index 17a7db0..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_library(otherlib ../empty.cpp)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-result.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
deleted file mode 100644
index 0d39596..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-CMake Warning \(dev\) at CMP0026-WARN.cmake:5 \(get_target_property\):
- Policy CMP0026 is not set: Disallow use of the LOCATION target property.
- Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The LOCATION property should not be read from target "somelib". Use the
- target name directly with add_custom_command, or use the generator
- expression \$<TARGET_FILE>, as appropriate.
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\):
- Policy CMP0026 is not set: Disallow use of the LOCATION target property.
- Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The LOCATION property should not be read from target "otherlib". Use the
- target name directly with add_custom_command, or use the generator
- expression \$<TARGET_FILE>, as appropriate.
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
deleted file mode 100644
index bfc9203..0000000
--- a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-
-enable_language(CXX)
-
-add_library(somelib empty.cpp)
-get_target_property(_loc somelib LOCATION)
-
-add_subdirectory(CMP0026-WARN-Dir)
-get_target_property(_loc otherlib LOCATION)
diff --git a/Tests/RunCMake/CMP0026/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMakeLists.txt
index 4b3de84..bf2ef15 100644
--- a/Tests/RunCMake/CMP0026/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0026/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt
deleted file mode 100644
index 6377921..0000000
--- a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at LOCATION-and-TARGET_OBJECTS.cmake:[0-9]+ \(get_target_property\):
- Policy CMP0026 is not set: Disallow use of the LOCATION target property.
- Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The LOCATION property should not be read from target "bar". Use the target
- name directly with add_custom_command, or use the generator expression
- \$<TARGET_FILE>, as appropriate.
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
deleted file mode 100644
index ee5ed5b..0000000
--- a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_policy(SET CMP0118 NEW)
-enable_language(CXX)
-
-add_library(foo OBJECT empty.cpp)
-add_executable(bar $<TARGET_OBJECTS:foo>)
-get_target_property(location bar LOCATION)
diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
deleted file mode 100644
index 360d987..0000000
--- a/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at ObjlibNotDefined.cmake:[0-9]+ \(get_target_property\):
- Policy CMP0026 is not set: Disallow use of the LOCATION target property.
- Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The LOCATION property should not be read from target "objlibuser". Use the
- target name directly with add_custom_command, or use the generator
- expression \$<TARGET_FILE>, as appropriate.
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake b/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake
deleted file mode 100644
index 194760c..0000000
--- a/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-
-enable_language(CXX)
-
-add_executable(objlibuser
- empty.cpp
- $<TARGET_OBJECTS:bar>
-)
-
-get_target_property(_location objlibuser LOCATION)
-
-add_library(bar OBJECT
- empty.cpp
-)
diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
index 6476176..7684eb6 100644
--- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
@@ -1,16 +1,6 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0026-WARN)
-run_cmake(CMP0026-OLD)
run_cmake(CMP0026-NEW)
run_cmake(CMP0026-IMPORTED)
run_cmake(CMP0026-CONFIG-LOCATION-NEW)
-run_cmake(CMP0026-CONFIG-LOCATION-OLD)
-run_cmake(CMP0026-CONFIG-LOCATION-WARN)
run_cmake(CMP0026-LOCATION-CONFIG-NEW)
-run_cmake(CMP0026-LOCATION-CONFIG-OLD)
-run_cmake(CMP0026-LOCATION-CONFIG-WARN)
-run_cmake(ObjlibNotDefined)
-run_cmake(LOCATION-and-TARGET_OBJECTS)
-run_cmake(clear-cached-information)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
deleted file mode 100644
index c51e883..0000000
--- a/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-
-add_executable(Hello ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
deleted file mode 100644
index 3525704..0000000
--- a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at clear-cached-information.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0026 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information.cmake b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
deleted file mode 100644
index 9916948..0000000
--- a/Tests/RunCMake/CMP0026/clear-cached-information.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-cmake_policy(SET CMP0118 NEW)
-enable_language(C)
-
-cmake_policy(SET CMP0026 OLD)
-
-add_subdirectory(clear-cached-information-dir)
-
-# Critical: this needs to happen in root CMakeLists.txt and not inside
-# the subdir.
-get_target_property(mypath Hello LOCATION)
-# Now we create the file later, so you can see, ultimately no error should
-# happen e.g. during generate phase:
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c)
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c PROPERTIES GENERATED TRUE)
diff --git a/Tests/RunCMake/CMP0027/CMP0027-OLD-result.txt b/Tests/RunCMake/CMP0027/CMP0027-OLD-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0027/CMP0027-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0027/CMP0027-OLD-stderr.txt b/Tests/RunCMake/CMP0027/CMP0027-OLD-stderr.txt
deleted file mode 100644
index 4c2b300..0000000
--- a/Tests/RunCMake/CMP0027/CMP0027-OLD-stderr.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-CMake Warning \(dev\) in CMakeLists.txt:
- Imported target "testTarget" includes non-existent path
-
- "/does/not/exist"
-
- in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
- \* The path was deleted, renamed, or moved to another location.
-
- \* An install or uninstall procedure did not complete successfully.
-
- \* The installation package was faulty and references files it does not
- provide.
diff --git a/Tests/RunCMake/CMP0027/CMP0027-OLD.cmake b/Tests/RunCMake/CMP0027/CMP0027-OLD.cmake
deleted file mode 100644
index 404217d..0000000
--- a/Tests/RunCMake/CMP0027/CMP0027-OLD.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-
-enable_language(CXX)
-
-cmake_policy(SET CMP0027 OLD)
-
-add_library(testTarget UNKNOWN IMPORTED)
-set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "/does/not/exist")
-
-add_library(userTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
-target_link_libraries(userTarget PRIVATE $<1:testTarget>)
diff --git a/Tests/RunCMake/CMP0027/CMP0027-WARN-result.txt b/Tests/RunCMake/CMP0027/CMP0027-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0027/CMP0027-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0027/CMP0027-WARN-stderr.txt b/Tests/RunCMake/CMP0027/CMP0027-WARN-stderr.txt
deleted file mode 100644
index 9bcec3c..0000000
--- a/Tests/RunCMake/CMP0027/CMP0027-WARN-stderr.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-CMake Warning \(dev\) in CMakeLists.txt:
- Policy CMP0027 is not set: Conditionally linked imported targets with
- missing include directories. Run "cmake --help-policy CMP0027" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- Imported target "testTarget" includes non-existent path
-
- "/does/not/exist"
-
- in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
- \* The path was deleted, renamed, or moved to another location.
-
- \* An install or uninstall procedure did not complete successfully.
-
- \* The installation package was faulty and references files it does not
- provide.
diff --git a/Tests/RunCMake/CMP0027/CMP0027-WARN.cmake b/Tests/RunCMake/CMP0027/CMP0027-WARN.cmake
deleted file mode 100644
index 8e5f9b5..0000000
--- a/Tests/RunCMake/CMP0027/CMP0027-WARN.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-
-enable_language(CXX)
-
-add_library(testTarget UNKNOWN IMPORTED)
-set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "/does/not/exist")
-
-add_library(userTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
-target_link_libraries(userTarget PRIVATE $<1:testTarget>)
diff --git a/Tests/RunCMake/CMP0027/CMakeLists.txt b/Tests/RunCMake/CMP0027/CMakeLists.txt
index 4b3de84..bf2ef15 100644
--- a/Tests/RunCMake/CMP0027/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0027/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0027/RunCMakeTest.cmake b/Tests/RunCMake/CMP0027/RunCMakeTest.cmake
index 1017f01..98460d8 100644
--- a/Tests/RunCMake/CMP0027/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0027/RunCMakeTest.cmake
@@ -1,5 +1,3 @@
include(RunCMake)
run_cmake(CMP0027-NEW)
-run_cmake(CMP0027-OLD)
-run_cmake(CMP0027-WARN)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt
index ec2315f..7f5458c 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt
@@ -1,18 +1,18 @@
-CMake Error at CMP0037-NEW-colon.cmake:4 \(add_library\):
+CMake Error at CMP0037-NEW-colon.cmake:[0-9]+ \(add_library\):
The target name "lib:colon" is reserved or not valid for certain CMake
features, such as generator expressions, and may result in undefined
behavior.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
-CMake Error at CMP0037-NEW-colon.cmake:5 \(add_executable\):
+CMake Error at CMP0037-NEW-colon.cmake:[0-9]+ \(add_executable\):
The target name "exe:colon" is reserved or not valid for certain CMake
features, such as generator expressions, and may result in undefined
behavior.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
-CMake Error at CMP0037-NEW-colon.cmake:6 \(add_custom_target\):
+CMake Error at CMP0037-NEW-colon.cmake:[0-9]+ \(add_custom_target\):
The target name "custom:colon" is reserved or not valid for certain CMake
features, such as generator expressions, and may result in undefined
behavior.
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake
index fd56e75..13724ee 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake
@@ -1,5 +1,4 @@
enable_language(CXX)
-cmake_policy(SET CMP0037 NEW)
add_library("lib:colon" empty.cpp)
add_executable("exe:colon" empty.cpp)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt
index 5789e38..945786e 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt
@@ -1,17 +1,17 @@
-CMake Error at CMP0037-NEW-reserved.cmake:4 \(add_library\):
+CMake Error at CMP0037-NEW-reserved.cmake:[0-9]+ \(add_library\):
The target name "all" is reserved or not valid for certain CMake features,
such as generator expressions, and may result in undefined behavior.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
-CMake Error at CMP0037-NEW-reserved.cmake:5 \(add_executable\):
+CMake Error at CMP0037-NEW-reserved.cmake:[0-9]+ \(add_executable\):
The target name "clean" is reserved or not valid for certain CMake
features, such as generator expressions, and may result in undefined
behavior.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
-CMake Error at CMP0037-NEW-reserved.cmake:6 \(add_custom_target\):
+CMake Error at CMP0037-NEW-reserved.cmake:[0-9]+ \(add_custom_target\):
The target name "help" is reserved or not valid for certain CMake features,
such as generator expressions, and may result in undefined behavior.
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved.cmake
index 83a7119..a56c7f8 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved.cmake
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved.cmake
@@ -1,5 +1,4 @@
enable_language(CXX)
-cmake_policy(SET CMP0037 NEW)
add_library(all empty.cpp)
add_executable(clean empty.cpp)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt
index e14cec0..61abe5b 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt
@@ -1,18 +1,18 @@
-CMake Error at CMP0037-NEW-space.cmake:4 \(add_library\):
+CMake Error at CMP0037-NEW-space.cmake:[0-9]+ \(add_library\):
The target name "lib with spaces" is reserved or not valid for certain
CMake features, such as generator expressions, and may result in undefined
behavior.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
-CMake Error at CMP0037-NEW-space.cmake:5 \(add_executable\):
+CMake Error at CMP0037-NEW-space.cmake:[0-9]+ \(add_executable\):
The target name "exe with spaces" is reserved or not valid for certain
CMake features, such as generator expressions, and may result in undefined
behavior.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
-CMake Error at CMP0037-NEW-space.cmake:6 \(add_custom_target\):
+CMake Error at CMP0037-NEW-space.cmake:[0-9]+ \(add_custom_target\):
The target name "custom with spaces" is reserved or not valid for certain
CMake features, such as generator expressions, and may result in undefined
behavior.
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake
index 2a288cc..e4819f3 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake
@@ -1,5 +1,4 @@
enable_language(CXX)
-cmake_policy(SET CMP0037 NEW)
add_library("lib with spaces" empty.cpp)
add_executable("exe with spaces" empty.cpp)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt
deleted file mode 100644
index de09351..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0037-OLD-reserved.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0037 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved.cmake b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved.cmake
deleted file mode 100644
index f52e4d2..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-enable_language(CXX)
-cmake_policy(SET CMP0037 OLD)
-
-add_library(all empty.cpp)
-add_executable(clean empty.cpp)
-add_custom_target(help)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt
deleted file mode 100644
index 4d13e59..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0037-OLD-space.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0037 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake b/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake
deleted file mode 100644
index c9fb6c8..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-enable_language(CXX)
-cmake_policy(SET CMP0037 OLD)
-
-add_library("lib with spaces" empty.cpp)
-add_executable("exe with spaces" empty.cpp)
-add_custom_target("custom with spaces")
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-result.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt
deleted file mode 100644
index d3b0e17..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:2 \(add_library\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "lib:colon" is reserved or not valid for certain CMake
- features, such as generator expressions, and may result in undefined
- behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:3 \(add_executable\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "exe:colon" is reserved or not valid for certain CMake
- features, such as generator expressions, and may result in undefined
- behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:4 \(add_custom_target\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "custom:colon" is reserved or not valid for certain CMake
- features, such as generator expressions, and may result in undefined
- behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake
deleted file mode 100644
index 1b1a405..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-enable_language(CXX)
-add_library("lib:colon" empty.cpp)
-add_executable("exe:colon" empty.cpp)
-add_custom_target("custom:colon")
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved-stderr.txt
deleted file mode 100644
index 2d556a7..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved-stderr.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-CMake Warning \(dev\) at CMP0037-WARN-reserved.cmake:2 \(add_library\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "all" is reserved or not valid for certain CMake features,
- such as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN-reserved.cmake:3 \(add_executable\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "clean" is reserved or not valid for certain CMake
- features, such as generator expressions, and may result in undefined
- behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN-reserved.cmake:4 \(add_custom_target\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "help" is reserved or not valid for certain CMake features,
- such as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved.cmake
deleted file mode 100644
index a5e0f10..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-enable_language(CXX)
-add_library(all empty.cpp)
-add_executable(clean empty.cpp)
-add_custom_target(help)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-result.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt
deleted file mode 100644
index e39477a..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-CMake Warning \(dev\) at CMP0037-WARN-space.cmake:2 \(add_library\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "lib with spaces" is reserved or not valid for certain
- CMake features, such as generator expressions, and may result in undefined
- behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN-space.cmake:3 \(add_executable\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "exe with spaces" is reserved or not valid for certain
- CMake features, such as generator expressions, and may result in undefined
- behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN-space.cmake:4 \(add_custom_target\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "custom with spaces" is reserved or not valid for certain
- CMake features, such as generator expressions, and may result in undefined
- behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake
deleted file mode 100644
index e01b8e5..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-enable_language(CXX)
-add_library("lib with spaces" empty.cpp)
-add_executable("exe with spaces" empty.cpp)
-add_custom_target("custom with spaces")
diff --git a/Tests/RunCMake/CMP0037/CMakeLists.txt b/Tests/RunCMake/CMP0037/CMakeLists.txt
index 4b3de84..bf2ef15 100644
--- a/Tests/RunCMake/CMP0037/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0037/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0037/NEW-cond-package-stderr.txt b/Tests/RunCMake/CMP0037/NEW-cond-package-stderr.txt
index 270fa6d..8f408bf 100644
--- a/Tests/RunCMake/CMP0037/NEW-cond-package-stderr.txt
+++ b/Tests/RunCMake/CMP0037/NEW-cond-package-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Error at NEW-cond-package.cmake:4 \(add_custom_target\):
+^CMake Error at NEW-cond-package.cmake:[0-9]+ \(add_custom_target\):
The target name "package" is reserved when CPack packaging is enabled.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/NEW-cond-package.cmake b/Tests/RunCMake/CMP0037/NEW-cond-package.cmake
index ceea907..93ae7a5 100644
--- a/Tests/RunCMake/CMP0037/NEW-cond-package.cmake
+++ b/Tests/RunCMake/CMP0037/NEW-cond-package.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0037 NEW)
file(WRITE "${CMAKE_BINARY_DIR}/CPackConfig.cmake" "")
add_custom_target(test)
add_custom_target(package)
diff --git a/Tests/RunCMake/CMP0037/NEW-cond-package_source-stderr.txt b/Tests/RunCMake/CMP0037/NEW-cond-package_source-stderr.txt
index 2d32147..85a678e 100644
--- a/Tests/RunCMake/CMP0037/NEW-cond-package_source-stderr.txt
+++ b/Tests/RunCMake/CMP0037/NEW-cond-package_source-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Error at NEW-cond-package_source.cmake:5 \(add_custom_target\):
+^CMake Error at NEW-cond-package_source.cmake:[0-9]+ \(add_custom_target\):
The target name "package_source" is reserved when CPack source packaging is
enabled.
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/CMP0037/NEW-cond-package_source.cmake b/Tests/RunCMake/CMP0037/NEW-cond-package_source.cmake
index 3f8883b..8345707 100644
--- a/Tests/RunCMake/CMP0037/NEW-cond-package_source.cmake
+++ b/Tests/RunCMake/CMP0037/NEW-cond-package_source.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0037 NEW)
file(WRITE "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake" "")
add_custom_target(test)
add_custom_target(package)
diff --git a/Tests/RunCMake/CMP0037/NEW-cond-test-stderr.txt b/Tests/RunCMake/CMP0037/NEW-cond-test-stderr.txt
index 44b4741..c7cbdf4 100644
--- a/Tests/RunCMake/CMP0037/NEW-cond-test-stderr.txt
+++ b/Tests/RunCMake/CMP0037/NEW-cond-test-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Error at NEW-cond-test.cmake:3 \(add_custom_target\):
+^CMake Error at NEW-cond-test.cmake:[0-9]+ \(add_custom_target\):
The target name "test" is reserved when CTest testing is enabled.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/NEW-cond-test.cmake b/Tests/RunCMake/CMP0037/NEW-cond-test.cmake
index 7eeaffc..dba3215 100644
--- a/Tests/RunCMake/CMP0037/NEW-cond-test.cmake
+++ b/Tests/RunCMake/CMP0037/NEW-cond-test.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0037 NEW)
enable_testing()
add_custom_target(test)
add_custom_target(package)
diff --git a/Tests/RunCMake/CMP0037/NEW-cond.cmake b/Tests/RunCMake/CMP0037/NEW-cond.cmake
index d0dc77af..0bfdbe1 100644
--- a/Tests/RunCMake/CMP0037/NEW-cond.cmake
+++ b/Tests/RunCMake/CMP0037/NEW-cond.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0037 NEW)
add_custom_target(test)
add_custom_target(package)
add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/OLD-cond-package-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-package-stderr.txt
deleted file mode 100644
index 5a29a49..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond-package-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at OLD-cond-package.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0037 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/OLD-cond-package.cmake b/Tests/RunCMake/CMP0037/OLD-cond-package.cmake
deleted file mode 100644
index 7a0afbe..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond-package.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_policy(SET CMP0037 OLD)
-file(WRITE "${CMAKE_BINARY_DIR}/CPackConfig.cmake" "")
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/OLD-cond-package_source-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-package_source-stderr.txt
deleted file mode 100644
index 5f72e16..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond-package_source-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at OLD-cond-package_source.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0037 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/OLD-cond-package_source.cmake b/Tests/RunCMake/CMP0037/OLD-cond-package_source.cmake
deleted file mode 100644
index 95616b6..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond-package_source.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_policy(SET CMP0037 OLD)
-file(WRITE "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake" "")
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/OLD-cond-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-stderr.txt
deleted file mode 100644
index 94e4575..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at OLD-cond.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0037 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/OLD-cond-test-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-test-stderr.txt
deleted file mode 100644
index 81e10ce..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond-test-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at OLD-cond-test.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0037 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0037/OLD-cond-test.cmake b/Tests/RunCMake/CMP0037/OLD-cond-test.cmake
deleted file mode 100644
index bfa32a9..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond-test.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_policy(SET CMP0037 OLD)
-enable_testing()
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/OLD-cond.cmake b/Tests/RunCMake/CMP0037/OLD-cond.cmake
deleted file mode 100644
index abad680..0000000
--- a/Tests/RunCMake/CMP0037/OLD-cond.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_policy(SET CMP0037 OLD)
-
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
index 89beb59..d6efdb2 100644
--- a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
@@ -1,56 +1,16 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-if(RunCMake_GENERATOR MATCHES "^Ninja")
- # Detect ninja version so we know what tests can be supported.
- execute_process(
- COMMAND "${RunCMake_MAKE_PROGRAM}" --version
- OUTPUT_VARIABLE ninja_out
- ERROR_VARIABLE ninja_out
- RESULT_VARIABLE ninja_res
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- if(ninja_res EQUAL 0 AND "x${ninja_out}" MATCHES "^x[0-9]+\\.[0-9]+")
- set(ninja_version "${ninja_out}")
- message(STATUS "ninja version: ${ninja_version}")
- else()
- message(FATAL_ERROR "'ninja --version' reported:\n${ninja_out}")
- endif()
-else()
- set(ninja_version "")
-endif()
-
-run_cmake(CMP0037-OLD-space)
run_cmake(CMP0037-NEW-space)
-run_cmake(CMP0037-WARN-space)
run_cmake(CMP0037-NEW-colon)
-if(NOT (WIN32 AND "${RunCMake_GENERATOR}" MATCHES "Make"))
- run_cmake(CMP0037-WARN-colon)
-endif()
-
-if(NOT ninja_version VERSION_GREATER_EQUAL 1.10)
- run_cmake(CMP0037-WARN-reserved)
- run_cmake(CMP0037-OLD-reserved)
-endif()
run_cmake(CMP0037-NEW-reserved)
run_cmake(NEW-cond)
run_cmake(NEW-cond-test)
run_cmake(NEW-cond-package)
-run_cmake(OLD-cond)
-run_cmake(OLD-cond-test)
-run_cmake(OLD-cond-package)
-run_cmake(WARN-cond)
-run_cmake(WARN-cond-test)
-run_cmake(WARN-cond-package)
run_cmake(alias-test-NEW)
-run_cmake(alias-test-OLD)
-run_cmake(alias-test-WARN)
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
run_cmake(NEW-cond-package_source)
- run_cmake(OLD-cond-package_source)
- run_cmake(WARN-cond-package_source)
endif()
diff --git a/Tests/RunCMake/CMP0037/WARN-cond-package-stderr.txt b/Tests/RunCMake/CMP0037/WARN-cond-package-stderr.txt
deleted file mode 100644
index 5960e51..0000000
--- a/Tests/RunCMake/CMP0037/WARN-cond-package-stderr.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-^CMake Warning \(dev\) at WARN-cond-package.cmake:4 \(add_custom_target\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "package" is reserved when CPack packaging is enabled. It
- may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0037/WARN-cond-package.cmake b/Tests/RunCMake/CMP0037/WARN-cond-package.cmake
deleted file mode 100644
index 61cdc68..0000000
--- a/Tests/RunCMake/CMP0037/WARN-cond-package.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-file(WRITE "${CMAKE_BINARY_DIR}/CPackConfig.cmake" "")
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/WARN-cond-package_source-stderr.txt b/Tests/RunCMake/CMP0037/WARN-cond-package_source-stderr.txt
deleted file mode 100644
index ae72909..0000000
--- a/Tests/RunCMake/CMP0037/WARN-cond-package_source-stderr.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-^CMake Warning \(dev\) at WARN-cond-package_source.cmake:5 \(add_custom_target\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "package_source" is reserved when CPack source packaging is
- enabled. It may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0037/WARN-cond-package_source.cmake b/Tests/RunCMake/CMP0037/WARN-cond-package_source.cmake
deleted file mode 100644
index 468380c..0000000
--- a/Tests/RunCMake/CMP0037/WARN-cond-package_source.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-file(WRITE "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake" "")
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/WARN-cond-test-stderr.txt b/Tests/RunCMake/CMP0037/WARN-cond-test-stderr.txt
deleted file mode 100644
index e7a3ee5..0000000
--- a/Tests/RunCMake/CMP0037/WARN-cond-test-stderr.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-^CMake Warning \(dev\) at WARN-cond-test.cmake:3 \(add_custom_target\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern. Run "cmake --help-policy CMP0037" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The target name "test" is reserved when CTest testing is enabled. It may
- result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0037/WARN-cond-test.cmake b/Tests/RunCMake/CMP0037/WARN-cond-test.cmake
deleted file mode 100644
index 982af36..0000000
--- a/Tests/RunCMake/CMP0037/WARN-cond-test.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-enable_testing()
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/WARN-cond.cmake b/Tests/RunCMake/CMP0037/WARN-cond.cmake
deleted file mode 100644
index 04a7f9d..0000000
--- a/Tests/RunCMake/CMP0037/WARN-cond.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-
-add_custom_target(test)
-add_custom_target(package)
-add_custom_target(package_source)
diff --git a/Tests/RunCMake/CMP0037/alias-test-NEW.cmake b/Tests/RunCMake/CMP0037/alias-test-NEW.cmake
index 32569b5..bb880a3 100644
--- a/Tests/RunCMake/CMP0037/alias-test-NEW.cmake
+++ b/Tests/RunCMake/CMP0037/alias-test-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0037 NEW)
include(alias-test-common.cmake)
diff --git a/Tests/RunCMake/CMP0037/alias-test-OLD-stderr.txt b/Tests/RunCMake/CMP0037/alias-test-OLD-stderr.txt
deleted file mode 100644
index bf177e2..0000000
--- a/Tests/RunCMake/CMP0037/alias-test-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at alias-test-OLD\.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0037 will be removed from a future version
- of CMake\.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances\. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD\.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0037/alias-test-OLD.cmake b/Tests/RunCMake/CMP0037/alias-test-OLD.cmake
deleted file mode 100644
index 1f3e770..0000000
--- a/Tests/RunCMake/CMP0037/alias-test-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0037 OLD)
-include(alias-test-common.cmake)
diff --git a/Tests/RunCMake/CMP0037/alias-test-WARN-stderr.txt b/Tests/RunCMake/CMP0037/alias-test-WARN-stderr.txt
deleted file mode 100644
index 43bf98b..0000000
--- a/Tests/RunCMake/CMP0037/alias-test-WARN-stderr.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-^CMake Warning \(dev\) at alias-test-common\.cmake:[0-9]+ \(add_library\):
- Policy CMP0037 is not set: Target names should not be reserved and should
- match a validity pattern\. Run "cmake --help-policy CMP0037" for policy
- details\. Use the cmake_policy command to set the policy and suppress this
- warning\.
-
- The target name "test" is reserved when CTest testing is enabled\. It may
- result in undefined behavior\.
-Call Stack \(most recent call first\):
- alias-test-WARN\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0037/alias-test-WARN.cmake b/Tests/RunCMake/CMP0037/alias-test-WARN.cmake
deleted file mode 100644
index 688cb95..0000000
--- a/Tests/RunCMake/CMP0037/alias-test-WARN.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-# leave CMP0037 unset
-include(alias-test-common.cmake)
diff --git a/Tests/RunCMake/CMP0038/CMP0038-NEW-stderr.txt b/Tests/RunCMake/CMP0038/CMP0038-NEW-stderr.txt
index 3d0a428..9685758 100644
--- a/Tests/RunCMake/CMP0038/CMP0038-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0038/CMP0038-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0038-NEW.cmake:3 \(add_library\):
+CMake Error at CMP0038-NEW.cmake:1 \(add_library\):
Target "self_link" links to itself.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0038/CMP0038-NEW.cmake b/Tests/RunCMake/CMP0038/CMP0038-NEW.cmake
index 6296b83..0e3df1d 100644
--- a/Tests/RunCMake/CMP0038/CMP0038-NEW.cmake
+++ b/Tests/RunCMake/CMP0038/CMP0038-NEW.cmake
@@ -1,4 +1,2 @@
-
-cmake_policy(SET CMP0038 NEW)
add_library(self_link empty.cpp)
target_link_libraries(self_link self_link)
diff --git a/Tests/RunCMake/CMP0038/CMP0038-OLD-stderr.txt b/Tests/RunCMake/CMP0038/CMP0038-OLD-stderr.txt
deleted file mode 100644
index c754128..0000000
--- a/Tests/RunCMake/CMP0038/CMP0038-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0038-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0038 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0038/CMP0038-OLD.cmake b/Tests/RunCMake/CMP0038/CMP0038-OLD.cmake
deleted file mode 100644
index 3752821..0000000
--- a/Tests/RunCMake/CMP0038/CMP0038-OLD.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-
-cmake_policy(SET CMP0038 OLD)
-add_library(self_link empty.cpp)
-target_link_libraries(self_link self_link)
diff --git a/Tests/RunCMake/CMP0038/CMP0038-WARN-result.txt b/Tests/RunCMake/CMP0038/CMP0038-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0038/CMP0038-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0038/CMP0038-WARN-stderr.txt b/Tests/RunCMake/CMP0038/CMP0038-WARN-stderr.txt
deleted file mode 100644
index 64631e7..0000000
--- a/Tests/RunCMake/CMP0038/CMP0038-WARN-stderr.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-CMake Warning \(dev\) at CMP0038-WARN.cmake:2 \(add_library\):
- Policy CMP0038 is not set: Targets may not link directly to themselves.
- Run "cmake --help-policy CMP0038" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- Target "self_link" links to itself.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0038/CMP0038-WARN.cmake b/Tests/RunCMake/CMP0038/CMP0038-WARN.cmake
deleted file mode 100644
index 5b92d09..0000000
--- a/Tests/RunCMake/CMP0038/CMP0038-WARN.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-
-add_library(self_link empty.cpp)
-target_link_libraries(self_link self_link)
diff --git a/Tests/RunCMake/CMP0038/CMakeLists.txt b/Tests/RunCMake/CMP0038/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0038/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0038/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0038/RunCMakeTest.cmake b/Tests/RunCMake/CMP0038/RunCMakeTest.cmake
index 3e7b5f3..06f8808 100644
--- a/Tests/RunCMake/CMP0038/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0038/RunCMakeTest.cmake
@@ -1,6 +1,3 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0038-WARN)
run_cmake(CMP0038-NEW)
-run_cmake(CMP0038-OLD)
diff --git a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt
index 3d9d225..d294b2f 100644
--- a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt
@@ -1,5 +1,5 @@
-CMake Error at CMP0039-NEW.cmake:7 \(target_link_libraries\):
+CMake Error at CMP0039-NEW\.cmake:[0-9]+ \(target_link_libraries\):
Utility target "utility" must not be used as the target of a
- target_link_libraries call.
+ target_link_libraries call\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0039/CMP0039-NEW.cmake b/Tests/RunCMake/CMP0039/CMP0039-NEW.cmake
index 2032d64..6f3a7d3 100644
--- a/Tests/RunCMake/CMP0039/CMP0039-NEW.cmake
+++ b/Tests/RunCMake/CMP0039/CMP0039-NEW.cmake
@@ -1,6 +1,3 @@
-
-cmake_policy(SET CMP0039 NEW)
-
add_custom_target(utility
COMMAND ${CMAKE_COMMAND} -E echo test
)
diff --git a/Tests/RunCMake/CMP0039/CMP0039-OLD-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-OLD-stderr.txt
deleted file mode 100644
index d7863fd..0000000
--- a/Tests/RunCMake/CMP0039/CMP0039-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0039-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0039 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0039/CMP0039-OLD.cmake b/Tests/RunCMake/CMP0039/CMP0039-OLD.cmake
deleted file mode 100644
index 9a513f4..0000000
--- a/Tests/RunCMake/CMP0039/CMP0039-OLD.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-cmake_policy(SET CMP0039 OLD)
-
-add_custom_target(utility
- COMMAND ${CMAKE_COMMAND} -E echo test
-)
-target_link_libraries(utility m)
diff --git a/Tests/RunCMake/CMP0039/CMP0039-WARN-result.txt b/Tests/RunCMake/CMP0039/CMP0039-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0039/CMP0039-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0039/CMP0039-WARN-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-WARN-stderr.txt
deleted file mode 100644
index a8e6c70..0000000
--- a/Tests/RunCMake/CMP0039/CMP0039-WARN-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-CMake Warning \(dev\) at CMP0039-WARN.cmake:5 \(target_link_libraries\):
- Policy CMP0039 is not set: Utility targets may not have link dependencies.
- Run "cmake --help-policy CMP0039" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- Utility target "utility" should not be used as the target of a
- target_link_libraries call.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0039/CMP0039-WARN.cmake b/Tests/RunCMake/CMP0039/CMP0039-WARN.cmake
deleted file mode 100644
index 6249993..0000000
--- a/Tests/RunCMake/CMP0039/CMP0039-WARN.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-add_custom_target(utility
- COMMAND ${CMAKE_COMMAND} -E echo test
-)
-target_link_libraries(utility m)
diff --git a/Tests/RunCMake/CMP0039/CMakeLists.txt b/Tests/RunCMake/CMP0039/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0039/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0039/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0039/RunCMakeTest.cmake b/Tests/RunCMake/CMP0039/RunCMakeTest.cmake
index ce7541a..abfd4d2 100644
--- a/Tests/RunCMake/CMP0039/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0039/RunCMakeTest.cmake
@@ -1,6 +1,3 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0039-WARN)
run_cmake(CMP0039-NEW)
-run_cmake(CMP0039-OLD)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake
index 880b178..f0af023 100644
--- a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake
@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0040 NEW)
-
add_library(foobar empty.cpp)
add_custom_command(TARGET foobar PRE_BUILD
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt
index 4a1077c..d577dc1 100644
--- a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0040-NEW-missing-target.cmake:3 \(add_custom_command\):
- No TARGET 'foobar' has been created in this directory.
+^CMake Error at CMP0040-NEW-missing-target.cmake:[0-9]+ \(add_custom_command\):
+ No TARGET 'foobar' has been created in this directory\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake
index a9f764c..e3fdbb2 100644
--- a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake
@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0040 NEW)
-
add_custom_command(TARGET foobar PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E hello world
)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt
deleted file mode 100644
index f38c03d..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0040-OLD-existing-target.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0040 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake
deleted file mode 100644
index 7a9e91e..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_policy(SET CMP0040 OLD)
-
-add_library(foobar empty.cpp)
-
-add_custom_command(TARGET foobar PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E echo hello world
-)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt
deleted file mode 100644
index 61f4f03..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0040-OLD-missing-target.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0040 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake
deleted file mode 100644
index 0f5cd15..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_policy(SET CMP0040 OLD)
-
-add_custom_command(TARGET foobar PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E echo hello world
-)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt
deleted file mode 100644
index 70ed05b..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-CMake Warning \(dev\) at CMP0040-WARN-missing-target.cmake:2 \(add_custom_command\):
- Policy CMP0040 is not set: The target in the TARGET signature of
- add_custom_command\(\) must exist and must be defined in the current
- directory. Run "cmake --help-policy CMP0040" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-+
- No TARGET 'foobar' has been created in this directory.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake
deleted file mode 100644
index 4efeaae..0000000
--- a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-
-add_custom_command(TARGET foobar PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E hello world
-)
diff --git a/Tests/RunCMake/CMP0040/CMakeLists.txt b/Tests/RunCMake/CMP0040/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0040/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0040/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0040/RunCMakeTest.cmake b/Tests/RunCMake/CMP0040/RunCMakeTest.cmake
index e5e6c37..b6fd899 100644
--- a/Tests/RunCMake/CMP0040/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0040/RunCMakeTest.cmake
@@ -1,9 +1,4 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0040-OLD-missing-target)
run_cmake(CMP0040-NEW-missing-target)
-run_cmake(CMP0040-WARN-missing-target)
-
-run_cmake(CMP0040-OLD-existing-target)
run_cmake(CMP0040-NEW-existing-target)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt
deleted file mode 100644
index 1b736da..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0041-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0041 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake b/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake
deleted file mode 100644
index 16cbced..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-
-cmake_policy(SET CMP0041 OLD)
-
-add_library(foo empty.cpp)
-set_property(TARGET foo
- PROPERTY INTERFACE_INCLUDE_DIRECTORIES
- include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
-)
-install(TARGETS foo EXPORT FooExport DESTINATION lib)
-install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt b/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt
deleted file mode 100644
index a7d303e..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-CMake Warning in CMakeLists.txt:
- Policy CMP0041 is not set: Error on relative include with generator
- expression. Run "cmake --help-policy CMP0041" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains relative path:
-
- "include/\$<TARGET_PROPERTY:NAME>"
-
-
-CMake Warning in CMakeLists.txt:
- Policy CMP0041 is not set: Error on relative include with generator
- expression. Run "cmake --help-policy CMP0041" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
-
- ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
-
- which is prefixed in the source directory.
-
-
-CMake Warning in CMakeLists.txt:
- Policy CMP0041 is not set: Error on relative include with generator
- expression. Run "cmake --help-policy CMP0041" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
-
- ".*/Tests/RunCMake/CMP0041/CMP0041-WARN-build/include/\$<TARGET_PROPERTY:NAME>"
-
- which is prefixed in the build directory.
diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake b/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake
deleted file mode 100644
index 873cbc7..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-
-add_library(foo empty.cpp)
-set_property(TARGET foo
- PROPERTY INTERFACE_INCLUDE_DIRECTORIES
- include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
-)
-install(TARGETS foo EXPORT FooExport DESTINATION lib)
-install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt
deleted file mode 100644
index dbc5167..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0041-tid-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0041 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake
deleted file mode 100644
index b5c4e7f..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-
-cmake_policy(SET CMP0041 OLD)
-
-add_library(foo empty.cpp)
-target_include_directories(foo INTERFACE
- include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
-)
-install(TARGETS foo EXPORT FooExport DESTINATION lib)
-install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt
deleted file mode 100644
index aae2c7a..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-CMake Warning in CMakeLists.txt:
- Policy CMP0041 is not set: Error on relative include with generator
- expression. Run "cmake --help-policy CMP0041" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
-
- ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
-
- which is prefixed in the source directory.
-
-
-CMake Warning in CMakeLists.txt:
- Policy CMP0041 is not set: Error on relative include with generator
- expression. Run "cmake --help-policy CMP0041" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
-
- ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
-
- which is prefixed in the source directory.
-
-
-CMake Warning in CMakeLists.txt:
- Policy CMP0041 is not set: Error on relative include with generator
- expression. Run "cmake --help-policy CMP0041" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
-
- ".*/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-build/include/\$<TARGET_PROPERTY:NAME>"
-
- which is prefixed in the build directory.
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake
deleted file mode 100644
index ee4c2a6..0000000
--- a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-
-add_library(foo empty.cpp)
-target_include_directories(foo INTERFACE
- include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
- ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
-)
-install(TARGETS foo EXPORT FooExport DESTINATION lib)
-install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMakeLists.txt b/Tests/RunCMake/CMP0041/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0041/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0041/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
index 93378c2..0c99cda 100644
--- a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
@@ -1,16 +1,11 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
# Protect tests from running inside the default install prefix.
set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
-run_cmake(CMP0041-OLD)
run_cmake(CMP0041-NEW)
-run_cmake(CMP0041-WARN)
# Protect tests from running inside the default install prefix.
set(RunCMake_TEST_OPTIONS "--install-prefix ${RunCMake_BINARY_DIR}/NotDefaultPrefix")
-run_cmake(CMP0041-tid-OLD)
run_cmake(CMP0041-tid-NEW)
-run_cmake(CMP0041-tid-WARN)
diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt b/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake b/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake
index 778a444..424cf83 100644
--- a/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake
+++ b/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake
@@ -1,4 +1 @@
-
-cmake_policy(SET CMP0042 NEW)
-
add_library(foo SHARED empty.cpp)
diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt
deleted file mode 100644
index 9d1488d..0000000
--- a/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0042-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0042 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake b/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake
deleted file mode 100644
index 1aede96..0000000
--- a/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-
-cmake_policy(SET CMP0042 OLD)
-
-add_library(foo SHARED empty.cpp)
diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt b/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt
deleted file mode 100644
index f3574a1..0000000
--- a/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-CMake Warning \(dev\):
- Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
- --help-policy CMP0042" for policy details. Use the cmake_policy command to
- set the policy and suppress this warning.
-
- MACOSX_RPATH is not specified for the following targets:
-
- foo
-
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake b/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake
deleted file mode 100644
index 3fa32b1..0000000
--- a/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-
-add_library(foo SHARED empty.cpp)
-add_library(foo-static STATIC empty.cpp)
-add_library(foo2 SHARED empty.cpp)
-set_target_properties(foo2 PROPERTIES MACOSX_RPATH 1)
-add_library(foo3 SHARED empty.cpp)
-set_target_properties(foo3 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@loader_path")
-add_library(foo4 SHARED empty.cpp)
-set_target_properties(foo4 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath")
diff --git a/Tests/RunCMake/CMP0042/CMakeLists.txt b/Tests/RunCMake/CMP0042/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0042/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0042/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0042/RunCMakeTest.cmake b/Tests/RunCMake/CMP0042/RunCMakeTest.cmake
index 6b23145..79ee5d1 100644
--- a/Tests/RunCMake/CMP0042/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0042/RunCMakeTest.cmake
@@ -1,6 +1,3 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0042-OLD)
run_cmake(CMP0042-NEW)
-run_cmake(CMP0042-WARN)
diff --git a/Tests/RunCMake/CMP0043/CMP0043-NEW-result.txt b/Tests/RunCMake/CMP0043/CMP0043-NEW-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0043/CMP0043-NEW-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0043/CMP0043-NEW.cmake b/Tests/RunCMake/CMP0043/CMP0043-NEW.cmake
deleted file mode 100644
index 857153d..0000000
--- a/Tests/RunCMake/CMP0043/CMP0043-NEW.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-cmake_policy(SET CMP0043 NEW)
-
-add_library(foo empty.cpp)
-set_property(TARGET foo
- PROPERTY COMPILE_DEFINITIONS_DEBUG "DEBUG_MODE"
-)
diff --git a/Tests/RunCMake/CMP0043/CMP0043-OLD-stderr.txt b/Tests/RunCMake/CMP0043/CMP0043-OLD-stderr.txt
deleted file mode 100644
index ebbb361..0000000
--- a/Tests/RunCMake/CMP0043/CMP0043-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0043-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0043 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0043/CMP0043-OLD.cmake b/Tests/RunCMake/CMP0043/CMP0043-OLD.cmake
deleted file mode 100644
index f379430..0000000
--- a/Tests/RunCMake/CMP0043/CMP0043-OLD.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-cmake_policy(SET CMP0043 OLD)
-
-add_library(foo empty.cpp)
-set_property(TARGET foo
- PROPERTY COMPILE_DEFINITIONS_DEBUG "DEBUG_MODE"
-)
diff --git a/Tests/RunCMake/CMP0043/CMP0043-WARN-result.txt b/Tests/RunCMake/CMP0043/CMP0043-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0043/CMP0043-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0043/CMP0043-WARN-stderr.txt b/Tests/RunCMake/CMP0043/CMP0043-WARN-stderr.txt
deleted file mode 100644
index 4769a63..0000000
--- a/Tests/RunCMake/CMP0043/CMP0043-WARN-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Warning \(dev\) in CMakeLists.txt:
- Policy CMP0043 is not set: Ignore COMPILE_DEFINITIONS_<Config> properties.
- Run "cmake --help-policy CMP0043" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0043/CMP0043-WARN.cmake b/Tests/RunCMake/CMP0043/CMP0043-WARN.cmake
deleted file mode 100644
index 161a60d..0000000
--- a/Tests/RunCMake/CMP0043/CMP0043-WARN.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-add_library(foo empty.cpp)
-set_property(TARGET foo
- PROPERTY COMPILE_DEFINITIONS_DEBUG "DEBUG_MODE"
-)
diff --git a/Tests/RunCMake/CMP0043/CMakeLists.txt b/Tests/RunCMake/CMP0043/CMakeLists.txt
deleted file mode 100644
index cc8a6f8..0000000
--- a/Tests/RunCMake/CMP0043/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12)
-project(${RunCMake_TEST} CXX)
-include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir
-
-if(CMAKE_BUILD_TYPE)
- # Dummy variable use
-endif()
diff --git a/Tests/RunCMake/CMP0043/RunCMakeTest.cmake b/Tests/RunCMake/CMP0043/RunCMakeTest.cmake
deleted file mode 100644
index b940528..0000000
--- a/Tests/RunCMake/CMP0043/RunCMakeTest.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-
-list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
-
-run_cmake(CMP0043-OLD)
-run_cmake(CMP0043-NEW)
-run_cmake(CMP0043-WARN)
diff --git a/Tests/RunCMake/CMP0043/empty.cpp b/Tests/RunCMake/CMP0043/empty.cpp
deleted file mode 100644
index 11ec041..0000000
--- a/Tests/RunCMake/CMP0043/empty.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
- int empty()
-{
- return 0;
-}
diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt
index 805a85e..0b27f60 100644
--- a/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0045-NEW.cmake:4 \(get_target_property\):
+CMake Error at CMP0045-NEW.cmake:[0-9]+ \(get_target_property\):
get_target_property\(\) called with non-existent target "tgt".
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake b/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake
index 7b2a3cd..ee1c19f 100644
--- a/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake
+++ b/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake
@@ -1,4 +1 @@
-
-cmake_policy(SET CMP0045 NEW)
-
get_target_property(result tgt TYPE)
diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt
deleted file mode 100644
index 0dac20f..0000000
--- a/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0045-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0045 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake b/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake
deleted file mode 100644
index 90201a3..0000000
--- a/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-
-cmake_policy(SET CMP0045 OLD)
-
-get_target_property(result tgt TYPE)
diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt b/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt
deleted file mode 100644
index 4c53224..0000000
--- a/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-CMake Warning \(dev\) at CMP0045-WARN.cmake:2 \(get_target_property\):
- Policy CMP0045 is not set: Error on non-existent target in
- get_target_property. Run "cmake --help-policy CMP0045" for policy details.
- Use the cmake_policy command to set the policy and suppress this warning.
-
- get_target_property\(\) called with non-existent target "tgt".
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake b/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake
deleted file mode 100644
index 86a99a0..0000000
--- a/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-
-get_target_property(result tgt TYPE)
diff --git a/Tests/RunCMake/CMP0045/CMakeLists.txt b/Tests/RunCMake/CMP0045/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0045/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0045/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0045/RunCMakeTest.cmake b/Tests/RunCMake/CMP0045/RunCMakeTest.cmake
index 009d455..ad92464 100644
--- a/Tests/RunCMake/CMP0045/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0045/RunCMakeTest.cmake
@@ -1,6 +1,3 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0045-OLD)
run_cmake(CMP0045-NEW)
-run_cmake(CMP0045-WARN)
diff --git a/Tests/RunCMake/CMP0046/CMP0046-Duplicate-result.txt b/Tests/RunCMake/CMP0046/CMP0046-Duplicate-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-Duplicate-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0046/CMP0046-Duplicate-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-Duplicate-stderr.txt
deleted file mode 100644
index fb31d6d..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-Duplicate-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-CMake Warning \(dev\) at CMP0046-Duplicate.cmake:5 \(add_dependencies\):
- Policy CMP0046 is not set: Error on non-existent dependency in
- add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
- Use the cmake_policy command to set the policy and suppress this warning.
-
- The dependency target "ctgt_no_exist" of target "dummy" does not exist.
-Call Stack \(most recent call first\):
- CMP0046-Duplicate.cmake:8 \(add_dep\)
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0046/CMP0046-Duplicate.cmake b/Tests/RunCMake/CMP0046/CMP0046-Duplicate.cmake
deleted file mode 100644
index 26e640b..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-Duplicate.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-
-add_library(dummy empty.cpp)
-
-macro(add_dep)
- add_dependencies(dummy ctgt_no_exist)
-endmacro()
-
-add_dep()
-add_dep()
diff --git a/Tests/RunCMake/CMP0046/CMP0046-NEW-existing-dependency.cmake b/Tests/RunCMake/CMP0046/CMP0046-NEW-existing-dependency.cmake
index 0be290a..245d023 100644
--- a/Tests/RunCMake/CMP0046/CMP0046-NEW-existing-dependency.cmake
+++ b/Tests/RunCMake/CMP0046/CMP0046-NEW-existing-dependency.cmake
@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0046 NEW)
-
add_custom_target(foo)
add_custom_target(bar)
add_dependencies(foo bar)
diff --git a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt
index 381647f..09f08d7 100644
--- a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt
+++ b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0046-NEW-missing-dependency.cmake:4 \(add_dependencies\):
+CMake Error at CMP0046-NEW-missing-dependency.cmake:[0-9]+ \(add_dependencies\):
The dependency target "bar" of target "foo" does not exist.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency.cmake b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency.cmake
index 9bb6b90..896fa40 100644
--- a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency.cmake
+++ b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency.cmake
@@ -1,4 +1,2 @@
-cmake_policy(SET CMP0046 NEW)
-
add_custom_target(foo)
add_dependencies(foo bar)
diff --git a/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency-stderr.txt
deleted file mode 100644
index 4444118..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0046-OLD-existing-dependency.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0046 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency.cmake b/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency.cmake
deleted file mode 100644
index b22ab4f..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_policy(SET CMP0046 OLD)
-
-add_custom_target(foo)
-add_custom_target(bar)
-add_dependencies(foo bar)
diff --git a/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency-stderr.txt
deleted file mode 100644
index 525954f..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0046-OLD-missing-dependency.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0046 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency.cmake b/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency.cmake
deleted file mode 100644
index 5ee3cb7..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_policy(SET CMP0046 OLD)
-
-add_custom_target(foo)
-add_dependencies(foo bar)
diff --git a/Tests/RunCMake/CMP0046/CMP0046-WARN-missing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-WARN-missing-dependency-stderr.txt
deleted file mode 100644
index fed36f1..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-WARN-missing-dependency-stderr.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-CMake Warning \(dev\) at CMP0046-WARN-missing-dependency.cmake:2 \(add_dependencies\):
- Policy CMP0046 is not set: Error on non-existent dependency in
- add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
- Use the cmake_policy command to set the policy and suppress this warning.
-+
- The dependency target "bar" of target "foo" does not exist.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0046/CMP0046-WARN-missing-dependency.cmake b/Tests/RunCMake/CMP0046/CMP0046-WARN-missing-dependency.cmake
deleted file mode 100644
index 896fa40..0000000
--- a/Tests/RunCMake/CMP0046/CMP0046-WARN-missing-dependency.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-add_custom_target(foo)
-add_dependencies(foo bar)
diff --git a/Tests/RunCMake/CMP0046/CMakeLists.txt b/Tests/RunCMake/CMP0046/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0046/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0046/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0046/RunCMakeTest.cmake b/Tests/RunCMake/CMP0046/RunCMakeTest.cmake
index 86b749a..f4e22e3 100644
--- a/Tests/RunCMake/CMP0046/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0046/RunCMakeTest.cmake
@@ -1,10 +1,4 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0046-OLD-missing-dependency)
run_cmake(CMP0046-NEW-missing-dependency)
-run_cmake(CMP0046-WARN-missing-dependency)
-
-run_cmake(CMP0046-OLD-existing-dependency)
run_cmake(CMP0046-NEW-existing-dependency)
-run_cmake(CMP0046-Duplicate)
diff --git a/Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt b/Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt
index ff787e8..b22cc4e 100644
--- a/Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt
@@ -1,6 +1,9 @@
-CMake Error at CMP0049-NEW.cmake:5 \(add_library\):
- Legacy variable expansion in source file "\${tgt_srcs}" expanded to
- "empty.cpp" in target "tgt". This behavior will be removed in a future
- version of CMake.
-Call Stack \(most recent call first\):
+CMake Error at CMP0049-NEW.cmake:[0-9]+ \(add_library\):
+ Cannot find source file:
+
+ \${tgt_srcs}
+
+ Tried extensions ([^
+]+
+)+Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0049/CMP0049-NEW.cmake b/Tests/RunCMake/CMP0049/CMP0049-NEW.cmake
index 85b5aa8..ce4cded 100644
--- a/Tests/RunCMake/CMP0049/CMP0049-NEW.cmake
+++ b/Tests/RunCMake/CMP0049/CMP0049-NEW.cmake
@@ -1,5 +1,2 @@
-
-cmake_policy(SET CMP0049 NEW)
-
set(tgt_srcs empty.cpp)
add_library(tgt \${tgt_srcs})
diff --git a/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt b/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt
deleted file mode 100644
index b373970..0000000
--- a/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0049-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0049 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0049/CMP0049-OLD.cmake b/Tests/RunCMake/CMP0049/CMP0049-OLD.cmake
deleted file mode 100644
index ae6fd3b..0000000
--- a/Tests/RunCMake/CMP0049/CMP0049-OLD.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-cmake_policy(SET CMP0049 OLD)
-
-set(tgt_srcs empty.cpp)
-add_library(tgt \${tgt_srcs})
diff --git a/Tests/RunCMake/CMP0049/CMP0049-WARN-result.txt b/Tests/RunCMake/CMP0049/CMP0049-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0049/CMP0049-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0049/CMP0049-WARN-stderr.txt b/Tests/RunCMake/CMP0049/CMP0049-WARN-stderr.txt
deleted file mode 100644
index 0cf5ce3..0000000
--- a/Tests/RunCMake/CMP0049/CMP0049-WARN-stderr.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-CMake Warning \(dev\) at CMP0049-WARN.cmake:3 \(add_library\):
- Policy CMP0049 is not set: Do not expand variables in target source
- entries. Run "cmake --help-policy CMP0049" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-
- Legacy variable expansion in source file "\${tgt_srcs}" expanded to
- "empty.cpp" in target "tgt". This behavior will be removed in a future
- version of CMake.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0049/CMP0049-WARN.cmake b/Tests/RunCMake/CMP0049/CMP0049-WARN.cmake
deleted file mode 100644
index ada082e..0000000
--- a/Tests/RunCMake/CMP0049/CMP0049-WARN.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-
-set(tgt_srcs empty.cpp)
-add_library(tgt \${tgt_srcs})
diff --git a/Tests/RunCMake/CMP0049/CMakeLists.txt b/Tests/RunCMake/CMP0049/CMakeLists.txt
index a06591c..c814f14 100644
--- a/Tests/RunCMake/CMP0049/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0049/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0049/RunCMakeTest.cmake b/Tests/RunCMake/CMP0049/RunCMakeTest.cmake
index e71f31e..70b2b44 100644
--- a/Tests/RunCMake/CMP0049/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0049/RunCMakeTest.cmake
@@ -1,6 +1,3 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-run_cmake(CMP0049-OLD)
run_cmake(CMP0049-NEW)
-run_cmake(CMP0049-WARN)
diff --git a/Tests/RunCMake/CMP0050/CMP0050-NEW-result.txt b/Tests/RunCMake/CMP0050/CMP0050-NEW-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/CMP0050/CMP0050-NEW-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/CMP0050/CMP0050-NEW.cmake b/Tests/RunCMake/CMP0050/CMP0050-NEW.cmake
deleted file mode 100644
index cdc65b8..0000000
--- a/Tests/RunCMake/CMP0050/CMP0050-NEW.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-
-cmake_policy(SET CMP0050 NEW)
-
-add_library(empty empty.cpp)
-add_custom_command(
- TARGET empty
- SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/input.h.in
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/input.h.in
- ${CMAKE_CURRENT_BINARY_DIR}/input.h
- OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/input.h
- DEPENDS ${CMAKE_COMMAND}
-)
diff --git a/Tests/RunCMake/CMP0050/CMP0050-OLD-stderr.txt b/Tests/RunCMake/CMP0050/CMP0050-OLD-stderr.txt
deleted file mode 100644
index 3e7fa97..0000000
--- a/Tests/RunCMake/CMP0050/CMP0050-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0050-OLD.cmake:2 \(cmake_policy\):
- The OLD behavior for policy CMP0050 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMP0050/CMP0050-OLD.cmake b/Tests/RunCMake/CMP0050/CMP0050-OLD.cmake
deleted file mode 100644
index efb37e5..0000000
--- a/Tests/RunCMake/CMP0050/CMP0050-OLD.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-
-cmake_policy(SET CMP0050 OLD)
-
-add_library(empty empty.cpp)
-add_custom_command(
- TARGET empty
- SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/input.h.in
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/input.h.in
- ${CMAKE_CURRENT_BINARY_DIR}/input.h
- OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/input.h
- DEPENDS ${CMAKE_COMMAND}
-)
diff --git a/Tests/RunCMake/CMP0050/CMP0050-WARN-result.txt b/Tests/RunCMake/CMP0050/CMP0050-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/CMP0050/CMP0050-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/CMP0050/CMP0050-WARN-stderr.txt b/Tests/RunCMake/CMP0050/CMP0050-WARN-stderr.txt
deleted file mode 100644
index c88d595..0000000
--- a/Tests/RunCMake/CMP0050/CMP0050-WARN-stderr.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-CMake Warning \(dev\) at CMP0050-WARN.cmake:3 \(add_custom_command\):
- Policy CMP0050 is not set: Disallow add_custom_command SOURCE signatures.
- Run "cmake --help-policy CMP0050" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The SOURCE signatures of add_custom_command are no longer supported.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0050/CMakeLists.txt b/Tests/RunCMake/CMP0050/CMakeLists.txt
deleted file mode 100644
index a06591c..0000000
--- a/Tests/RunCMake/CMP0050/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12)
-project(${RunCMake_TEST} CXX)
-include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0050/RunCMakeTest.cmake b/Tests/RunCMake/CMP0050/RunCMakeTest.cmake
deleted file mode 100644
index 526a9aa..0000000
--- a/Tests/RunCMake/CMP0050/RunCMakeTest.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
-
-run_cmake(CMP0050-OLD)
-run_cmake(CMP0050-NEW)
-run_cmake(CMP0050-WARN)
diff --git a/Tests/RunCMake/CMP0050/empty.cpp b/Tests/RunCMake/CMP0050/empty.cpp
deleted file mode 100644
index bf7d5c9..0000000
--- a/Tests/RunCMake/CMP0050/empty.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-
-#include "input.h"
-
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
- int empty()
-{
- return 0;
-}
diff --git a/Tests/RunCMake/CMP0050/input.h.in b/Tests/RunCMake/CMP0050/input.h.in
deleted file mode 100644
index d8c5d26..0000000
--- a/Tests/RunCMake/CMP0050/input.h.in
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#define INPUT
diff --git a/Tests/RunCMake/CMP0068/CMP0068-NEW.cmake b/Tests/RunCMake/CMP0068/CMP0068-NEW.cmake
index eb8cfa1..a1e6d6a 100644
--- a/Tests/RunCMake/CMP0068/CMP0068-NEW.cmake
+++ b/Tests/RunCMake/CMP0068/CMP0068-NEW.cmake
@@ -1,6 +1,5 @@
cmake_policy(SET CMP0068 NEW)
-cmake_policy(SET CMP0042 NEW)
add_library(foo SHARED empty.cpp)
set_target_properties(foo PROPERTIES INSTALL_NAME_DIR "@rpath" INSTALL_RPATH "@loader_path/" BUILD_WITH_INSTALL_RPATH 1)
diff --git a/Tests/RunCMake/CMP0068/CMP0068-OLD.cmake b/Tests/RunCMake/CMP0068/CMP0068-OLD.cmake
index cf1040f..fdc82bb 100644
--- a/Tests/RunCMake/CMP0068/CMP0068-OLD.cmake
+++ b/Tests/RunCMake/CMP0068/CMP0068-OLD.cmake
@@ -1,6 +1,5 @@
cmake_policy(SET CMP0068 OLD)
-cmake_policy(SET CMP0042 NEW)
add_library(foo SHARED empty.cpp)
set_target_properties(foo PROPERTIES INSTALL_NAME_DIR "@rpath" INSTALL_RPATH "@loader_path/" BUILD_WITH_INSTALL_RPATH 1)
diff --git a/Tests/RunCMake/CMP0068/CMP0068-WARN.cmake b/Tests/RunCMake/CMP0068/CMP0068-WARN.cmake
index b7ec480..bf1ec34 100644
--- a/Tests/RunCMake/CMP0068/CMP0068-WARN.cmake
+++ b/Tests/RunCMake/CMP0068/CMP0068-WARN.cmake
@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0042 NEW)
-
add_library(foo SHARED empty.cpp)
add_library(foo-static STATIC empty.cpp)
add_library(foo2 SHARED empty.cpp)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 9eaa7bd..2e9890f 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -21,6 +21,9 @@
if(CMAKE_C_COMPILER_ID STREQUAL "LCC")
list(APPEND TEST_ARGS -DRunCMake_TEST_LCC=1)
endif()
+ if(DEFINED CMake_TEST_E2K_BROKEN_LIBC)
+ list(APPEND TEST_ARGS -DRunCMake_TEST_E2K_BROKEN_LIBC=${CMake_TEST_E2K_BROKEN_LIBC})
+ endif()
add_test(NAME RunCMake.${test} COMMAND ${CMAKE_CMAKE_COMMAND}
-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}
-DRunCMake_GENERATOR_IS_MULTI_CONFIG=${_isMultiConfig}
@@ -107,11 +110,9 @@
if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
add_RunCMake_test(CMP0042)
endif()
-add_RunCMake_test(CMP0043)
add_RunCMake_test(CMP0045)
add_RunCMake_test(CMP0046)
add_RunCMake_test(CMP0049)
-add_RunCMake_test(CMP0050)
add_RunCMake_test(CMP0051)
add_RunCMake_test(CMP0053)
add_RunCMake_test(CMP0054)
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake
index 39a316f..7471446 100644
--- a/Tests/RunCMake/CPack/DEB/Helpers.cmake
+++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake
@@ -70,12 +70,7 @@
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_)
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index c026bf6..6b39119 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -5,19 +5,20 @@
# A debugedit binary is required for these tests, so skip them if it's not found
find_program(DEBUGEDIT debugedit)
+find_program(BRPALT brp-alt PATHS /usr/lib/rpm/)
# run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES"
run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM.CUSTOM_BINARY_SPEC_FILE" false "MONOLITHIC;COMPONENT")
run_cpack_test(CUSTOM_NAMES "RPM.CUSTOM_NAMES;DEB.CUSTOM_NAMES;TGZ;DragNDrop" true "COMPONENT")
run_cpack_test(AUTO_SUFFIXES "RPM.AUTO_SUFFIXES;DEB.AUTO_SUFFIXES" false "MONOLITHIC")
run_cpack_test(DEBUGINFO "DEB.DEBUGINFO" true "COMPONENT")
-if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
+if(DEBUGEDIT AND NOT BRPALT)
run_cpack_test(DEBUGINFO "RPM.DEBUGINFO" true "COMPONENT")
endif()
run_cpack_test(DEBUGINFO "DEB.DEBUGINFO" true "MONOLITHIC")
run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM.DEFAULT_PERMISSIONS;DEB.DEFAULT_PERMISSIONS" false "MONOLITHIC;COMPONENT")
run_cpack_test(DEPENDENCIES "DEB.DEPENDENCIES" true "COMPONENT")
-if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
+if(DEBUGEDIT AND NOT BRPALT)
run_cpack_test(DEPENDENCIES "RPM.DEPENDENCIES" true "COMPONENT")
endif()
run_cpack_test(DIST "RPM.DIST" false "MONOLITHIC")
@@ -30,7 +31,7 @@
run_cpack_test_subtests(GENERATE_SHLIBS "soversion_not_zero;soversion_zero" "DEB.GENERATE_SHLIBS" true "COMPONENT")
run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB.GENERATE_SHLIBS_LDCONFIG" true "COMPONENT")
run_cpack_test_subtests(INSTALL_SCRIPTS "default;no_scripts" "RPM.INSTALL_SCRIPTS" false "COMPONENT")
-if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
+if(DEBUGEDIT AND NOT BRPALT)
run_cpack_test_subtests(INSTALL_SCRIPTS "single_debug_info;no_scripts_single_debug_info" "RPM.INSTALL_SCRIPTS" false "COMPONENT")
endif()
run_cpack_test(LONG_FILENAMES "DEB.LONG_FILENAMES" false "MONOLITHIC")
@@ -43,13 +44,15 @@
run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM.PARTIALLY_RELOCATABLE_WARNING" false "COMPONENT")
run_cpack_test(PER_COMPONENT_FIELDS "RPM.PER_COMPONENT_FIELDS;DEB.PER_COMPONENT_FIELDS" false "COMPONENT")
run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component" "RPM.SINGLE_DEBUGINFO" true "CUSTOM")
-if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
+if(DEBUGEDIT AND NOT BRPALT)
run_cpack_test_subtests(SINGLE_DEBUGINFO "one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM.SINGLE_DEBUGINFO" true "CUSTOM")
endif()
-if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
+if(DEBUGEDIT AND NOT BRPALT)
run_cpack_test(EXTRA_SLASH_IN_PATH "RPM.EXTRA_SLASH_IN_PATH" true "COMPONENT")
endif()
-run_cpack_source_test(SOURCE_PACKAGE "RPM.SOURCE_PACKAGE")
+if(NOT BRPALT)
+ run_cpack_source_test(SOURCE_PACKAGE "RPM.SOURCE_PACKAGE")
+endif()
run_cpack_test(SUGGESTS "RPM.SUGGESTS" false "MONOLITHIC")
run_cpack_test(SYMLINKS "RPM.SYMLINKS;TGZ" false "MONOLITHIC;COMPONENT")
set(ENVIRONMENT "SOURCE_DATE_EPOCH=123456789")
@@ -68,7 +71,11 @@
false
"MONOLITHIC;COMPONENT"
)
-run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT")
+if(NOT BRPALT)
+ run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT")
+else()
+ run_cpack_test(PROJECT_META "DEB.PROJECT_META" false "MONOLITHIC;COMPONENT")
+endif()
run_cpack_test_package_target(PRE_POST_SCRIPTS "ZIP" false "MONOLITHIC;COMPONENT")
run_cpack_test_subtests(DUPLICATE_FILE "success;conflict_file;conflict_symlink" "TGZ" false "COMPONENT;GROUP")
run_cpack_test(COMPONENT_WITH_SPECIAL_CHARS "RPM.COMPONENT_WITH_SPECIAL_CHARS;DEB.COMPONENT_WITH_SPECIAL_CHARS;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ" false "MONOLITHIC;COMPONENT;GROUP")
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0029-NEW-stderr.txt
index e147081..52ec78d 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0029-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0029-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0029-NEW.cmake:2 \(subdir_depends\):
- The subdir_depends command should not be called; see CMP0029.
+CMake Error at CMP0029-NEW.cmake:1 \(subdir_depends\):
+ The subdir_depends command has been removed; see CMP0029.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0029-NEW.cmake
index 392b9d4..1ceb1f8 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0029-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0029-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0029 NEW)
subdir_depends()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt
deleted file mode 100644
index 430c865..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0029-OLD.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0029 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0029-OLD.cmake
deleted file mode 100644
index 099fd90..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0029-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0029 OLD)
-subdir_depends()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0029-WARN-stderr.txt
deleted file mode 100644
index 32a452a..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0029-WARN-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-CMake Warning \(dev\) at CMP0029-WARN.cmake:1 \(subdir_depends\):
- Policy CMP0029 is not set: The subdir_depends command should not be called.
- Run "cmake --help-policy CMP0029" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0029-WARN.cmake
deleted file mode 100644
index 1ceb1f8..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0029-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-subdir_depends()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt
index cb380db..f8919f5 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0030-NEW.cmake:2 \(use_mangled_mesa\):
- The use_mangled_mesa command should not be called; see CMP0030.
+CMake Error at CMP0030-NEW.cmake:1 \(use_mangled_mesa\):
+ The use_mangled_mesa command has been removed; see CMP0030.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake
index 73365a7..cbe0ff0 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0030 NEW)
use_mangled_mesa()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt
deleted file mode 100644
index d00b827..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-^CMake Deprecation Warning at CMP0030-OLD.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0030 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0030-OLD.cmake:2 \(use_mangled_mesa\):
- use_mangled_mesa called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD.cmake
deleted file mode 100644
index efbb852..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0030 OLD)
-use_mangled_mesa()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-stderr.txt
deleted file mode 100644
index db3c23f13..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0030-WARN.cmake:1 \(use_mangled_mesa\):
- Policy CMP0030 is not set: The use_mangled_mesa command should not be
- called. Run "cmake --help-policy CMP0030" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-
-CMake Error at CMP0030-WARN.cmake:1 \(use_mangled_mesa\):
- use_mangled_mesa called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN.cmake
deleted file mode 100644
index cbe0ff0..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-use_mangled_mesa()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0031-NEW-stderr.txt
index 78c2236..da23be8 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0031-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0031-NEW.cmake:2 \(load_command\):
- The load_command command should not be called; see CMP0031.
+CMake Error at CMP0031-NEW.cmake:1 \(load_command\):
+ The load_command command has been removed; see CMP0031.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0031-NEW.cmake
index 3d9caf2..9e9b1f4 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0031-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0031 NEW)
load_command()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0031-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0031-OLD-stderr.txt
deleted file mode 100644
index ba198d6..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-OLD-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at CMP0031-OLD.cmake:2 \(load_command\):
- load_command Attempt to load command failed from file.*bogus_command.*
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0031-OLD.cmake
deleted file mode 100644
index 8fedf98..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0031 OLD)
-load_command(bogus_command)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0031-WARN-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0031-WARN-stderr.txt
deleted file mode 100644
index 4cb65b3..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0031-WARN.cmake:1 \(load_command\):
- Policy CMP0031 is not set: The load_command command should not be called.
- Run "cmake --help-policy CMP0031" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-
-CMake Error at CMP0031-WARN.cmake:1 \(load_command\):
- load_command Attempt to load command failed from file.*bogus_command.*
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0031-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0031-WARN.cmake
deleted file mode 100644
index c9d99fc..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0031-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-load_command(bogus_command)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0032-NEW-stderr.txt
index c7ac16e..7b9f42a 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0032-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0032-NEW.cmake:2 \(output_required_files\):
- The output_required_files command should not be called; see CMP0032.
+CMake Error at CMP0032-NEW.cmake:1 \(output_required_files\):
+ The output_required_files command has been removed; see CMP0032.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0032-NEW.cmake
index c6fb5e8..7411e48 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0032-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0032 NEW)
output_required_files()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0032-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0032-OLD-stderr.txt
deleted file mode 100644
index 2223c42..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-OLD-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at CMP0032-OLD.cmake:2 \(output_required_files\):
- output_required_files called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0032-OLD.cmake
deleted file mode 100644
index 6585110..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0032 OLD)
-output_required_files()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0032-WARN-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0032-WARN-stderr.txt
deleted file mode 100644
index 0cf3f94..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0032-WARN.cmake:1 \(output_required_files\):
- Policy CMP0032 is not set: The output_required_files command should not be
- called. Run "cmake --help-policy CMP0032" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-
-CMake Error at CMP0032-WARN.cmake:1 \(output_required_files\):
- output_required_files called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0032-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0032-WARN.cmake
deleted file mode 100644
index 7411e48..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0032-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-output_required_files()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt
index 8d210aa..69e0439 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0033-NEW.cmake:2 \(export_library_dependencies\):
- The export_library_dependencies command should not be called; see CMP0033.
+CMake Error at CMP0033-NEW.cmake:1 \(export_library_dependencies\):
+ The export_library_dependencies command has been removed; see CMP0033.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake
index 6f90f29..f897ddd 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0033 NEW)
export_library_dependencies()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt
deleted file mode 100644
index e5dd2dd..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at CMP0033-OLD.cmake:2 \(export_library_dependencies\):
- export_library_dependencies called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake
deleted file mode 100644
index a3504b6..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0033 OLD)
-export_library_dependencies()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt
deleted file mode 100644
index e561dac..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0033-WARN.cmake:1 \(export_library_dependencies\):
- Policy CMP0033 is not set: The export_library_dependencies command should
- not be called. Run "cmake --help-policy CMP0033" for policy details. Use
- the cmake_policy command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-
-CMake Error at CMP0033-WARN.cmake:1 \(export_library_dependencies\):
- export_library_dependencies called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake
deleted file mode 100644
index f897ddd..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-export_library_dependencies()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0034-NEW-stderr.txt
index 1dd279b..a3d77a6 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0034-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0034-NEW.cmake:2 \(utility_source\):
- The utility_source command should not be called; see CMP0034.
+CMake Error at CMP0034-NEW.cmake:1 \(utility_source\):
+ The utility_source command has been removed; see CMP0034.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0034-NEW.cmake
index 48724a9..b4ae045 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0034-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0034 NEW)
utility_source()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0034-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0034-OLD-stderr.txt
deleted file mode 100644
index 3358628..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-OLD-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at CMP0034-OLD.cmake:2 \(utility_source\):
- utility_source called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0034-OLD.cmake
deleted file mode 100644
index a2c9798..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0034 OLD)
-utility_source()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0034-WARN-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0034-WARN-stderr.txt
deleted file mode 100644
index ea3831f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0034-WARN.cmake:1 \(utility_source\):
- Policy CMP0034 is not set: The utility_source command should not be called.
- Run "cmake --help-policy CMP0034" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-
-CMake Error at CMP0034-WARN.cmake:1 \(utility_source\):
- utility_source called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0034-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0034-WARN.cmake
deleted file mode 100644
index b4ae045..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0034-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-utility_source()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0035-NEW-stderr.txt
index 0604829..fb21197 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0035-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0035-NEW.cmake:2 \(variable_requires\):
- The variable_requires command should not be called; see CMP0035.
+CMake Error at CMP0035-NEW.cmake:1 \(variable_requires\):
+ The variable_requires command has been removed; see CMP0035.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0035-NEW.cmake
index 27eb32e..3af4de1 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0035-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0035 NEW)
variable_requires()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0035-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0035-OLD-stderr.txt
deleted file mode 100644
index 86eda43..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-OLD-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at CMP0035-OLD.cmake:2 \(variable_requires\):
- variable_requires called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0035-OLD.cmake
deleted file mode 100644
index 7425262..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0035 OLD)
-variable_requires()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0035-WARN-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0035-WARN-stderr.txt
deleted file mode 100644
index 4d4fc8e..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0035-WARN.cmake:1 \(variable_requires\):
- Policy CMP0035 is not set: The variable_requires command should not be
- called. Run "cmake --help-policy CMP0035" for policy details. Use the
- cmake_policy command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-
-CMake Error at CMP0035-WARN.cmake:1 \(variable_requires\):
- variable_requires called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0035-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0035-WARN.cmake
deleted file mode 100644
index 3af4de1..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0035-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-variable_requires()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0036-NEW-stderr.txt
index 11aabd0..f5e3f02 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-NEW-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0036-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0036-NEW.cmake:2 \(build_name\):
- The build_name command should not be called; see CMP0036.
+CMake Error at CMP0036-NEW.cmake:1 \(build_name\):
+ The build_name command has been removed; see CMP0036.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0036-NEW.cmake
index 5341db2..9556687 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-NEW.cmake
+++ b/Tests/RunCMake/DisallowedCommands/CMP0036-NEW.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0036 NEW)
build_name()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0036-OLD-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0036-OLD-stderr.txt
deleted file mode 100644
index fef195f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-OLD-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at CMP0036-OLD.cmake:2 \(build_name\):
- build_name called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0036-OLD.cmake
deleted file mode 100644
index fdd840f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-OLD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0036 OLD)
-build_name()
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0036-WARN-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0036-WARN-stderr.txt
deleted file mode 100644
index b9b7c5a..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0036-WARN.cmake:1 \(build_name\):
- Policy CMP0036 is not set: The build_name command should not be called.
- Run "cmake --help-policy CMP0036" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-
-CMake Error at CMP0036-WARN.cmake:1 \(build_name\):
- build_name called with incorrect number of arguments
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0036-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0036-WARN.cmake
deleted file mode 100644
index 9556687..0000000
--- a/Tests/RunCMake/DisallowedCommands/CMP0036-WARN.cmake
+++ /dev/null
@@ -1 +0,0 @@
-build_name()
diff --git a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt
index 927c9b4..bf2ef15 100644
--- a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12) # old enough to not set CMP0029 through CMP0036
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake
index f3974ea..c65bbd4 100644
--- a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake
+++ b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake
@@ -1,5 +1,4 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
foreach(p
CMP0029
@@ -11,7 +10,5 @@
CMP0035
CMP0036
)
- run_cmake(${p}-WARN)
- run_cmake(${p}-OLD)
run_cmake(${p}-NEW)
endforeach()
diff --git a/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in b/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in
index 48add61..697e055 100644
--- a/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in
+++ b/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in
@@ -46,52 +46,23 @@
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})
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt b/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt
index 5791993..f453253 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt
@@ -1,6 +1,3 @@
cmake_minimum_required(VERSION 3.17)
-if(RunCMake_TEST STREQUAL "LOCATION")
- cmake_minimum_required(VERSION 2.8.12) # Leave CMP0026 unset.
-endif()
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LOCATION-stderr.txt b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LOCATION-stderr.txt
deleted file mode 100644
index 468d2c5..0000000
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LOCATION-stderr.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-^CMake Deprecation Warning at CMakeLists\.txt:3 \(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\.
-+
-CMake Warning \(dev\) in CMakeLists\.txt:
- Policy CMP0026 is not set: Disallow use of the LOCATION target property.
- Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The LOCATION property should not be read from target "foo". Use the target
- name directly with add_custom_command, or use the generator expression
- \$<TARGET_FILE>, as appropriate.
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LOCATION.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LOCATION.cmake
deleted file mode 100644
index 8929cdb..0000000
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LOCATION.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-enable_language(C)
-add_library(foo empty.c)
-add_custom_target(drive COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:foo,LOCATION>)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/RunCMakeTest.cmake
index c278831..d877c52 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/RunCMakeTest.cmake
@@ -11,7 +11,6 @@
run_cmake(LinkImplementationCycle4)
run_cmake(LinkImplementationCycle5)
run_cmake(LinkImplementationCycle6)
-run_cmake(LOCATION)
run_cmake(SOURCES)
run_cmake(TransitiveBuild)
run_cmake(TransitiveLink-CMP0166-OLD)
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-result.txt b/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-stderr.txt b/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-stderr.txt
deleted file mode 100644
index 074cba0..0000000
--- a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-CMake Warning \(dev\) at CMP0044-WARN.cmake:13 \(target_compile_definitions\):
- Policy CMP0044 is not set: Case sensitive <LANG>_COMPILER_ID generator
- expressions. Run "cmake --help-policy CMP0044" for policy details. Use
- the cmake_policy command to set the policy and suppress this warning.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN.cmake b/Tests/RunCMake/GeneratorExpression/CMP0044-WARN.cmake
deleted file mode 100644
index dfa23e0..0000000
--- a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-
-enable_language(C)
-
-string(TOLOWER ${CMAKE_C_COMPILER_ID} lc_test)
-if (lc_test STREQUAL CMAKE_C_COMPILER_ID)
- string(TOUPPER ${CMAKE_C_COMPILER_ID} lc_test)
- if (lc_test STREQUAL CMAKE_C_COMPILER_ID)
- message(SEND_ERROR "Try harder.")
- endif()
-endif()
-
-add_library(cmp0044-check empty.c)
-target_compile_definitions(cmp0044-check
- PRIVATE
- Result=$<C_COMPILER_ID:${lc_test}>
- Type_Is_${CMP0044_TYPE}
-)
diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
index e828028..bf2ef15 100644
--- a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
+++ b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
@@ -1,6 +1,3 @@
cmake_minimum_required(VERSION 3.10)
-if(RunCMake_TEST STREQUAL "CMP0044-WARN")
- cmake_policy(VERSION 2.8.12) # old enough to not set CMP0044
-endif()
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 8ba70aa..985d91b 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -13,7 +13,6 @@
run_cmake(BadTargetTypeObject)
run_cmake(BadInstallPrefix)
run_cmake(BadSHELL_PATH)
-run_cmake(CMP0044-WARN)
run_cmake(NonValidTarget-C_COMPILER_ID)
run_cmake(NonValidTarget-CXX_COMPILER_ID)
run_cmake(NonValidTarget-Fortran_COMPILER_ID)
diff --git a/Tests/RunCMake/Graphviz/RunCMakeTest.cmake b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
index c0cea10..c804cb1 100644
--- a/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
@@ -66,7 +66,9 @@
run_test(no_static_libs GRAPHVIZ_STATIC_LIBS FALSE)
run_test(no_shared_libs GRAPHVIZ_SHARED_LIBS FALSE)
-run_test(no_module_libs GRAPHVIZ_MODULE_LIBS FALSE)
+if(NOT RunCMake_TEST_E2K_BROKEN_LIBC)
+ run_test(no_module_libs GRAPHVIZ_MODULE_LIBS FALSE)
+endif()
run_test(no_interface_libs GRAPHVIZ_INTERFACE_LIBS FALSE)
run_test(no_object_libs GRAPHVIZ_OBJECT_LIBS FALSE)
diff --git a/Tests/RunCMake/Instrumentation/check-data-dir.cmake b/Tests/RunCMake/Instrumentation/check-data-dir.cmake
index 5776ce0..fb3ca8e 100644
--- a/Tests/RunCMake/Instrumentation/check-data-dir.cmake
+++ b/Tests/RunCMake/Instrumentation/check-data-dir.cmake
@@ -8,6 +8,8 @@
set(FOUND_SNIPPETS "")
foreach(snippet ${snippets})
+ get_filename_component(filename ${snippet} NAME)
+
read_json(${snippet} contents)
# Verify snippet file is valid
@@ -19,7 +21,7 @@
endif()
# Verify target
- string(JSON target ERROR_VARIABLE noTarget GET ${contents} target)
+ string(JSON target ERROR_VARIABLE noTarget GET "${contents}" target)
if (NOT target MATCHES NOTFOUND)
set(targets "main;lib;customTarget;TARGET_NAME")
if (NOT ${target} IN_LIST targets)
@@ -28,16 +30,16 @@
endif()
# Verify output
- string(JSON result GET ${contents} result)
+ string(JSON result GET "${contents}" result)
if (NOT ${result} EQUAL 0)
snippet_error(${snippet} "Compile command had non-0 result")
endif()
# Verify contents of compile-* Snippets
- if (snippet MATCHES ^compile-)
- string(JSON target GET ${contents} target)
- string(JSON source GET ${contents} source)
- string(JSON language GET ${contents} language)
+ if (filename MATCHES ^compile-)
+ string(JSON target GET "${contents}" target)
+ string(JSON source GET "${contents}" source)
+ string(JSON language GET "${contents}" language)
if (NOT language MATCHES "C\\+\\+")
snippet_error(${snippet} "Expected C++ compile language")
endif()
@@ -47,33 +49,53 @@
endif()
# Verify contents of link-* Snippets
- if (snippet MATCHES ^link-)
- string(JSON target GET ${contents} target)
- string(JSON targetType GET ${contents} targetType)
+ if (filename MATCHES ^link-)
+ string(JSON target GET "${contents}" target)
+ string(JSON targetType GET "${contents}" targetType)
+ string(JSON targetLabels GET "${contents}" targetLabels)
if (target MATCHES main)
if (NOT targetType MATCHES "EXECUTABLE")
snippet_error(${snippet} "Expected EXECUTABLE, target type was ${targetType}")
endif()
+ string(JSON nlabels LENGTH "${targetLabels}")
+ if (NOT nlabels STREQUAL 2)
+ snippet_error(${snippet} "Missing Target Labels for: ${target}")
+ else()
+ string(JSON label1 GET "${contents}" targetLabels 0)
+ string(JSON label2 GET "${contents}" targetLabels 1)
+ if (NOT label1 MATCHES "label1" OR NOT label2 MATCHES "label2")
+ snippet_error(${snippet} "Missing Target Labels for: ${target}")
+ endif()
+ endif()
endif()
if (target MATCHES lib)
if (NOT targetType MATCHES "STATIC_LIBRARY")
snippet_error(${snippet} "Expected STATIC_LIBRARY, target type was ${targetType}")
endif()
+ string(JSON nlabels LENGTH "${targetLabels}")
+ if (NOT nlabels STREQUAL 1)
+ snippet_error(${snippet} "Missing Target Labels for: ${target}")
+ else()
+ string(JSON label ERROR_VARIABLE noLabels GET "${contents}" targetLabels 0)
+ if (NOT label MATCHES "label3")
+ snippet_error(${snippet} "Missing Target Labels for: ${target}")
+ endif()
+ endif()
endif()
endif()
# Verify contents of custom-* Snippets
- if (snippet MATCHES ^custom-)
- string(JSON outputs GET ${contents} outputs)
+ if (filename MATCHES ^custom-)
+ string(JSON outputs GET "${contents}" outputs)
if (NOT output1 MATCHES "output1" OR NOT output2 MATCHES "output2")
snippet_error(${snippet} "Custom command missing outputs")
endif()
endif()
# Verify contents of test-* Snippets
- if (snippet MATCHES ^test-)
- string(JSON testName GET ${contents} testName)
- if (NOT testName EQUAL "test")
+ if (filename MATCHES ^test-)
+ string(JSON testName GET "${contents}" testName)
+ if (NOT testName STREQUAL "test")
snippet_error(${snippet} "Unexpected testName: ${testName}")
endif()
endif()
diff --git a/Tests/RunCMake/Instrumentation/hook.cmake b/Tests/RunCMake/Instrumentation/hook.cmake
index d3be3a4..973e7d8 100644
--- a/Tests/RunCMake/Instrumentation/hook.cmake
+++ b/Tests/RunCMake/Instrumentation/hook.cmake
@@ -6,7 +6,7 @@
set(hasStaticInfo "UNEXPECTED")
endif()
read_json(${index} contents)
-string(JSON hook GET ${contents} hook)
+string(JSON hook GET "${contents}" hook)
# Output is verified by *-stdout.txt files that the HOOK is run
message(STATUS ${hook})
@@ -19,7 +19,7 @@
macro(has_key key json)
cmake_parse_arguments(ARG "UNEXPECTED" "" "" ${ARGN})
unset(missingKey)
- string(JSON ${key} ERROR_VARIABLE missingKey GET ${json} ${key})
+ string(JSON ${key} ERROR_VARIABLE missingKey GET "${json}" ${key})
if (NOT ARG_UNEXPECTED AND NOT "${missingKey}" MATCHES NOTFOUND)
add_error("\nKey \"${key}\" not in index:\n${json}")
elseif(ARG_UNEXPECTED AND "${missingKey}" MATCHES NOTFOUND)
@@ -39,7 +39,7 @@
string(JSON length LENGTH ${snippets})
math(EXPR length ${length}-1)
foreach(i RANGE ${length})
- string(JSON filename GET ${snippets} ${i})
+ string(JSON filename GET "${snippets}" ${i})
if (NOT EXISTS ${dataDir}/${filename})
add_error("Listed snippet: ${dataDir}/${filename} does not exist")
endif()
diff --git a/Tests/RunCMake/Instrumentation/verify-snippet.cmake b/Tests/RunCMake/Instrumentation/verify-snippet.cmake
index 5f23bf2..5c93c1e 100644
--- a/Tests/RunCMake/Instrumentation/verify-snippet.cmake
+++ b/Tests/RunCMake/Instrumentation/verify-snippet.cmake
@@ -9,44 +9,46 @@
endmacro()
macro(has_key snippet json key)
- string(JSON data ERROR_VARIABLE missingKey GET ${json} ${key})
+ string(JSON data ERROR_VARIABLE missingKey GET "${json}" ${key})
if (NOT ${missingKey} MATCHES NOTFOUND)
snippet_error(${snippet} "Missing ${key}")
endif()
endmacro()
macro(has_not_key snippet json key)
- string(JSON data ERROR_VARIABLE missingKey GET ${json} ${key})
+ string(JSON data ERROR_VARIABLE missingKey GET "${json}" ${key})
if (${missingKey} MATCHES NOTFOUND)
snippet_error(${snippet} "Has unexpected ${key}")
endif()
endmacro()
macro(snippet_has_fields snippet contents)
+ get_filename_component(filename ${snippet} NAME)
has_key(${snippet} ${contents} command)
has_key(${snippet} ${contents} role)
has_key(${snippet} ${contents} result)
- if (snippet MATCHES ^link-*)
+ if (filename MATCHES ^link-*)
has_key(${snippet} ${contents} target)
has_key(${snippet} ${contents} outputs)
has_key(${snippet} ${contents} outputSizes)
has_key(${snippet} ${contents} targetType)
- elseif (snippet MATCHES ^compile-*)
+ has_key(${snippet} ${contents} targetLabels)
+ elseif (filename MATCHES ^compile-*)
has_key(${snippet} ${contents} target)
has_key(${snippet} ${contents} outputs)
has_key(${snippet} ${contents} outputSizes)
has_key(${snippet} ${contents} source)
has_key(${snippet} ${contents} language)
- elseif (snippet MATCHES ^custom-*)
+ elseif (filename MATCHES ^custom-*)
has_key(${snippet} ${contents} target)
has_key(${snippet} ${contents} outputs)
has_key(${snippet} ${contents} outputSizes)
- elseif (snippet MATCHES ^test-*)
+ elseif (filename MATCHES ^test-*)
has_key(${snippet} ${contents} testName)
endif()
if(ARGS_DYNAMIC_QUERY)
has_key(${snippet} ${contents} dynamicSystemInformation)
- string(JSON dynamicSystemInfo ERROR_VARIABLE noInfo GET ${contents} dynamicSystemInformation)
+ string(JSON dynamicSystemInfo ERROR_VARIABLE noInfo GET "${contents}" dynamicSystemInformation)
if (noInfo MATCHES NOTFOUND)
has_key(${snippet} ${dynamicSystemInfo} beforeCPULoadAverage)
has_key(${snippet} ${dynamicSystemInfo} beforeHostMemoryUsed)
@@ -55,7 +57,7 @@
endif()
else()
has_not_key(${snippet} ${contents} dynamicSystemInformation)
- string(JSON dynamicSystemInfo ERROR_VARIABLE noInfo GET ${contents} dynamicSystemInformation)
+ string(JSON dynamicSystemInfo ERROR_VARIABLE noInfo GET "${contents}" dynamicSystemInformation)
if (noInfo MATCHES NOTFOUND)
has_not_key(${snippet} ${dynamicSystemInfo} beforeCPULoadAverage)
has_not_key(${snippet} ${dynamicSystemInfo} beforeHostMemoryUsed)
@@ -66,8 +68,8 @@
endmacro()
macro(snippet_valid_timing contents)
- string(JSON start GET ${contents} timeStart)
- string(JSON duration GET ${contents} duration)
+ string(JSON start GET "${contents}" timeStart)
+ string(JSON duration GET "${contents}" duration)
if (${start} LESS 0)
snippet_error(${snippet} "Negative time start: ${start}")
endif()
@@ -79,18 +81,18 @@
macro(verify_snippet snippet contents)
snippet_has_fields(${snippet} ${contents})
snippet_valid_timing(${contents})
- string(JSON version GET ${contents} version)
+ string(JSON version GET "${contents}" version)
if (NOT ${version} EQUAL 1)
snippet_error(${snippet} "Version must be 1, got: ${version}")
endif()
- string(JSON role GET ${contents} role)
+ string(JSON role GET "${contents}" role)
get_filename_component(filename ${snippet} NAME)
if (NOT ${filename} MATCHES ^${role}-)
snippet_error(${snippet} "Role \"${role}\" doesn't match snippet filename")
endif()
- string(JSON outputs ERROR_VARIABLE noOutputs GET ${contents} outputs)
+ string(JSON outputs ERROR_VARIABLE noOutputs GET "${contents}" outputs)
if (NOT outputs MATCHES NOTFOUND)
- string(JSON outputSizes ERROR_VARIABLE noOutputSizes GET ${contents} outputSizes)
+ string(JSON outputSizes ERROR_VARIABLE noOutputSizes GET "${contents}" outputSizes)
list(LENGTH outputs outputsLen)
list(LENGTH outputSizes outputSizesLen)
if (outputSizes MATCHES NOTFOUND OR NOT outputsLen EQUAL outputSizesLen)
diff --git a/Tests/RunCMake/InterfaceLibrary/invalid_name-stderr.txt b/Tests/RunCMake/InterfaceLibrary/invalid_name-stderr.txt
index e14fcde..a48bded 100644
--- a/Tests/RunCMake/InterfaceLibrary/invalid_name-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_name-stderr.txt
@@ -1,15 +1,20 @@
-CMake Error at invalid_name.cmake:2 \(add_library\):
- add_library Invalid name for INTERFACE library target: if\$ace
+^CMake Error at invalid_name\.cmake:1 \(add_library\):
+ The target name "if\$ace" is reserved or not valid for certain CMake
+ features, such as generator expressions, and may result in undefined
+ behavior\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
-CMake Error at invalid_name.cmake:4 \(add_library\):
- add_library Invalid name for INTERFACE library target: iface::target
+CMake Error at invalid_name\.cmake:2 \(add_library\):
+ The target name "iface::target" is reserved or not valid for certain CMake
+ features, such as generator expressions, and may result in undefined
+ behavior\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
-CMake Error at invalid_name.cmake:6 \(add_library\):
- add_library Invalid name for IMPORTED INTERFACE library target:
- if\$target_imported
+CMake Error at invalid_name\.cmake:3 \(add_library\):
+ The target name "if\$target_imported" is reserved or not valid for certain
+ CMake features, such as generator expressions, and may result in undefined
+ behavior\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/InterfaceLibrary/invalid_name.cmake b/Tests/RunCMake/InterfaceLibrary/invalid_name.cmake
index 4a8ca37..3c9a90a 100644
--- a/Tests/RunCMake/InterfaceLibrary/invalid_name.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_name.cmake
@@ -1,6 +1,3 @@
-cmake_policy(SET CMP0037 OLD)
add_library(if$ace INTERFACE)
-
add_library(iface::target INTERFACE)
-
add_library(if$target_imported INTERFACE IMPORTED)
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface-result.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface-stderr.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface-stderr.txt
deleted file mode 100644
index d756db1..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface-stderr.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-^CMake Deprecation Warning at CMakeLists\.txt:3 \(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\.
-+
-CMake Deprecation Warning at CMP0028-OLD-iface\.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0028 will be removed from a future version
- of CMake\.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface.cmake b/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface.cmake
deleted file mode 100644
index d7bd60e..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-iface.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-cmake_policy(SET CMP0028 OLD)
-
-add_library(iface INTERFACE)
-target_link_libraries(iface INTERFACE External::Library)
-add_library(foo empty.cpp)
-target_link_libraries(foo iface)
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-result.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-stderr.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-stderr.txt
deleted file mode 100644
index 8ebf949..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD-stderr.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-^CMake Deprecation Warning at CMakeLists\.txt:3 \(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\.
-+
-CMake Deprecation Warning at CMP0028-OLD\.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0028 will be removed from a future version
- of CMake\.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD.cmake b/Tests/RunCMake/LinkItemValidation/CMP0028-OLD.cmake
deleted file mode 100644
index d4a870b..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-OLD.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-cmake_policy(SET CMP0028 OLD)
-
-add_library(foo empty.cpp)
-target_link_libraries(foo PRIVATE External::Library)
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface-result.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface-stderr.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface-stderr.txt
deleted file mode 100644
index bb6a16e..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface-stderr.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-CMake Warning \(dev\) at CMP0028-WARN-iface\.cmake:3 \(target_link_libraries\):
- Policy CMP0028 is not set: Double colon in target name means ALIAS or
- IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
- Use the cmake_policy command to set the policy and suppress this warning.
-
- The link interface of target "iface" contains:
-
- External::Library
-
- but the target was not found. Possible reasons include:
-(
- \*[^
-]+)*
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface.cmake b/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface.cmake
deleted file mode 100644
index 9270023..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-iface.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-add_library(iface INTERFACE)
-target_link_libraries(iface INTERFACE External::Library)
-add_library(foo empty.cpp)
-target_link_libraries(foo iface)
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-result.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-stderr.txt b/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-stderr.txt
deleted file mode 100644
index c0cb5b0..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN-stderr.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-CMake Warning \(dev\) at CMP0028-WARN\.cmake:3 \(target_link_libraries\):
- Policy CMP0028 is not set: Double colon in target name means ALIAS or
- IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
- Use the cmake_policy command to set the policy and suppress this warning.
-
- Target "foo" links to:
-
- External::Library
-
- but the target was not found. Possible reasons include:
-(
- \*[^
-]+)*
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN.cmake b/Tests/RunCMake/LinkItemValidation/CMP0028-WARN.cmake
deleted file mode 100644
index 70a6cc6..0000000
--- a/Tests/RunCMake/LinkItemValidation/CMP0028-WARN.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-
-add_library(foo empty.cpp)
-target_link_libraries(foo PRIVATE External::Library)
diff --git a/Tests/RunCMake/LinkItemValidation/CMakeLists.txt b/Tests/RunCMake/LinkItemValidation/CMakeLists.txt
index 9467ea4..48cc6f4 100644
--- a/Tests/RunCMake/LinkItemValidation/CMakeLists.txt
+++ b/Tests/RunCMake/LinkItemValidation/CMakeLists.txt
@@ -1,6 +1,3 @@
cmake_minimum_required(VERSION 3.10)
-if(RunCMake_TEST MATCHES "^CMP0028")
- cmake_minimum_required(VERSION 2.8.12) # old enough to not set CMP0028
-endif()
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir
diff --git a/Tests/RunCMake/LinkItemValidation/RunCMakeTest.cmake b/Tests/RunCMake/LinkItemValidation/RunCMakeTest.cmake
index c423f6a..e94dc94 100644
--- a/Tests/RunCMake/LinkItemValidation/RunCMakeTest.cmake
+++ b/Tests/RunCMake/LinkItemValidation/RunCMakeTest.cmake
@@ -1,10 +1,6 @@
include(RunCMake)
run_cmake(CMP0028-NEW)
-run_cmake(CMP0028-OLD)
-run_cmake(CMP0028-WARN)
run_cmake(CMP0028-NEW-iface)
-run_cmake(CMP0028-OLD-iface)
-run_cmake(CMP0028-WARN-iface)
run_cmake(OnlyTargets)
diff --git a/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject.cmake b/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject.cmake
index db571a3..d9e9dde 100644
--- a/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject.cmake
+++ b/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject.cmake
@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0022 NEW)
-
enable_language(C)
add_library(AnObjLib OBJECT a.c)
diff --git a/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject2.cmake b/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject2.cmake
index 6bb8d5e..4c0842b 100644
--- a/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject2.cmake
+++ b/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject2.cmake
@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0022 NEW)
-
enable_language(C)
add_library(AnObjLib OBJECT a.c)
diff --git a/Tests/RunCMake/PolicyScope/CMakeLists.txt b/Tests/RunCMake/PolicyScope/CMakeLists.txt
index 667561e..30c0273 100644
--- a/Tests/RunCMake/PolicyScope/CMakeLists.txt
+++ b/Tests/RunCMake/PolicyScope/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake b/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake
index da608b3..9244d0d 100644
--- a/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake
@@ -1,7 +1,4 @@
include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
run_cmake(NotClosed)
run_cmake(NotOpened)
-run_cmake(parent-dir-generate-time)
-run_cmake(dir-in-macro-generate-time)
diff --git a/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time-result.txt b/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time-stderr.txt b/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time-stderr.txt
deleted file mode 100644
index d223f42..0000000
--- a/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Warning \(dev\) at dir1/CMakeLists.txt:5 \(target_compile_definitions\):
- Policy CMP0044 is not set: Case sensitive <LANG>_COMPILER_ID generator
- expressions. Run "cmake --help-policy CMP0044" for policy details. Use
- the cmake_policy command to set the policy and suppress this warning.
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time.cmake b/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time.cmake
deleted file mode 100644
index 04a7c2c..0000000
--- a/Tests/RunCMake/PolicyScope/dir-in-macro-generate-time.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-
-include(dir-in-macro-include.cmake)
diff --git a/Tests/RunCMake/PolicyScope/dir-in-macro-include.cmake b/Tests/RunCMake/PolicyScope/dir-in-macro-include.cmake
deleted file mode 100644
index fd326f1..0000000
--- a/Tests/RunCMake/PolicyScope/dir-in-macro-include.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-
-enable_language(CXX)
-
-# This does not affect dir1 despite being set before the add_subdirectory.
-cmake_policy(SET CMP0044 NEW)
-add_subdirectory(dir1)
diff --git a/Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt b/Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt
deleted file mode 100644
index 66ff016..0000000
--- a/Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-add_library(foo STATIC foo.cpp)
-string(TOLOWER ${CMAKE_CXX_COMPILER_ID} compiler_id)
-target_compile_definitions(foo PRIVATE Foo=$<CXX_COMPILER_ID:invalid,${compiler_id}>)
diff --git a/Tests/RunCMake/PolicyScope/dir1/foo.cpp b/Tests/RunCMake/PolicyScope/dir1/foo.cpp
deleted file mode 100644
index 766b775..0000000
--- a/Tests/RunCMake/PolicyScope/dir1/foo.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-
-int main()
-{
- return 0;
-}
diff --git a/Tests/RunCMake/PolicyScope/parent-dir-generate-time.cmake b/Tests/RunCMake/PolicyScope/parent-dir-generate-time.cmake
deleted file mode 100644
index a0842f7..0000000
--- a/Tests/RunCMake/PolicyScope/parent-dir-generate-time.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-enable_language(CXX)
-
-add_subdirectory(dir1)
-
-# This affects dir1 despite being set after the add_subdirectory.
-cmake_policy(SET CMP0044 NEW)
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index e88e343..3392f39 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -107,9 +107,6 @@
if(NOT DEFINED RunCMake_TEST_OPTIONS)
set(RunCMake_TEST_OPTIONS "")
endif()
- if(APPLE)
- list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW)
- endif()
if(RunCMake_TEST_LCC AND NOT RunCMake_TEST_NO_CMP0129)
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0129=NEW)
endif()
diff --git a/Tests/RunCMake/Syntax/CMakeLists.txt b/Tests/RunCMake/Syntax/CMakeLists.txt
index 4b3de84..2897109 100644
--- a/Tests/RunCMake/Syntax/CMakeLists.txt
+++ b/Tests/RunCMake/Syntax/CMakeLists.txt
@@ -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)
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index f56ac64..8f944b2 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -58,7 +58,9 @@
run_cmake(EscapeCharsAllowed)
run_cmake(NullAfterBackslash)
run_cmake(NullTerminatedArgument)
-include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake")
+if(NOT RunCMake_TEST_E2K_BROKEN_LIBC)
+ include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake")
+endif()
run_cmake(ParenNoSpace0)
run_cmake(ParenNoSpace1)
run_cmake(ParenNoSpace2)
@@ -69,7 +71,6 @@
run_cmake(UnterminatedString)
run_cmake(UnterminatedBrace0)
run_cmake(UnterminatedBrace1)
-run_cmake(UnterminatedBrace2)
run_cmake(UnterminatedBracket0)
run_cmake(UnterminatedBracket1)
run_cmake(UnterminatedBracketComment)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-result.txt
similarity index 100%
rename from Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt
rename to Tests/RunCMake/Syntax/UnterminatedBrace1-result.txt
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
index 3d88f36..4df56d1 100644
--- a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
@@ -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 @@
\${
- 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.
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
index 8b40b19..db39af7 100644
--- a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
@@ -1,2 +1,2 @@
-cmake_policy(SET CMP0010 OLD)
+cmake_policy(SET CMP0053 NEW)
set(var "${")
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
deleted file mode 100644
index 0d76251..0000000
--- a/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
+++ /dev/null
@@ -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\)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
deleted file mode 100644
index 30d4d4d..0000000
--- a/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-cmake_policy(SET CMP0010 OLD)
-cmake_policy(SET CMP0053 NEW)
-set(var "${")
diff --git a/Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake
index fb2eecc..3b4cc58 100644
--- a/Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake
+++ b/Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake
@@ -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.")
diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
index 28d0d29..3e92bb8 100644
--- a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
+++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
@@ -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.")
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
index 820591c..82049f2 100644
--- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -16,8 +16,7 @@
run_cmake(NoArguments)
run_cmake(NoOutputOrTarget)
run_cmake(OutputAndTarget)
-run_cmake(SourceByproducts)
-run_cmake(SourceUsesTerminal)
+run_cmake(SOURCE)
run_cmake(TargetImported)
run_cmake(TargetLiteralQuotes)
run_cmake(TargetNotInDir)
diff --git a/Tests/RunCMake/add_custom_command/SourceByproducts-result.txt b/Tests/RunCMake/add_custom_command/SOURCE-result.txt
similarity index 100%
rename from Tests/RunCMake/add_custom_command/SourceByproducts-result.txt
rename to Tests/RunCMake/add_custom_command/SOURCE-result.txt
diff --git a/Tests/RunCMake/CMP0050/CMP0050-NEW-stderr.txt b/Tests/RunCMake/add_custom_command/SOURCE-stderr.txt
similarity index 70%
rename from Tests/RunCMake/CMP0050/CMP0050-NEW-stderr.txt
rename to Tests/RunCMake/add_custom_command/SOURCE-stderr.txt
index e913b3f..95d3a5d 100644
--- a/Tests/RunCMake/CMP0050/CMP0050-NEW-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/SOURCE-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at CMP0050-NEW.cmake:5 \(add_custom_command\):
+CMake Error at SOURCE.cmake:[0-9]+ \(add_custom_command\):
The SOURCE signatures of add_custom_command are no longer supported.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0050/CMP0050-WARN.cmake b/Tests/RunCMake/add_custom_command/SOURCE.cmake
similarity index 98%
rename from Tests/RunCMake/CMP0050/CMP0050-WARN.cmake
rename to Tests/RunCMake/add_custom_command/SOURCE.cmake
index e57230e..1b464fb 100644
--- a/Tests/RunCMake/CMP0050/CMP0050-WARN.cmake
+++ b/Tests/RunCMake/add_custom_command/SOURCE.cmake
@@ -1,4 +1,3 @@
-
add_library(empty empty.cpp)
add_custom_command(
TARGET empty
diff --git a/Tests/RunCMake/add_custom_command/SourceByproducts-stderr.txt b/Tests/RunCMake/add_custom_command/SourceByproducts-stderr.txt
deleted file mode 100644
index a9cd64c..0000000
--- a/Tests/RunCMake/add_custom_command/SourceByproducts-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at SourceByproducts.cmake:1 \(add_custom_command\):
- add_custom_command BYPRODUCTS may not be specified with SOURCE signatures
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/SourceByproducts.cmake b/Tests/RunCMake/add_custom_command/SourceByproducts.cmake
deleted file mode 100644
index 824f41d..0000000
--- a/Tests/RunCMake/add_custom_command/SourceByproducts.cmake
+++ /dev/null
@@ -1 +0,0 @@
-add_custom_command(SOURCE t TARGET t BYPRODUCTS b)
diff --git a/Tests/RunCMake/add_custom_command/SourceUsesTerminal-result.txt b/Tests/RunCMake/add_custom_command/SourceUsesTerminal-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/add_custom_command/SourceUsesTerminal-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/add_custom_command/SourceUsesTerminal-stderr.txt b/Tests/RunCMake/add_custom_command/SourceUsesTerminal-stderr.txt
deleted file mode 100644
index 1a76c54..0000000
--- a/Tests/RunCMake/add_custom_command/SourceUsesTerminal-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at SourceUsesTerminal.cmake:1 \(add_custom_command\):
- add_custom_command USES_TERMINAL may not be used with SOURCE signatures
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/SourceUsesTerminal.cmake b/Tests/RunCMake/add_custom_command/SourceUsesTerminal.cmake
deleted file mode 100644
index 295fab1..0000000
--- a/Tests/RunCMake/add_custom_command/SourceUsesTerminal.cmake
+++ /dev/null
@@ -1 +0,0 @@
-add_custom_command(SOURCE t TARGET t USES_TERMINAL)
diff --git a/Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt b/Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt
index f352457..f3e7d05 100644
--- a/Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt
+++ b/Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt
@@ -1,17 +1,17 @@
CMake Error at BadTargetName.cmake:1 \(add_custom_target\):
- add_custom_target called with target name containing a "#". This character
- is not allowed.
+ The target name "#" is reserved or not valid for certain CMake features,
+ such as generator expressions, and may result in undefined behavior\.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
CMake Error at BadTargetName.cmake:2 \(add_custom_target\):
- add_custom_target called with target name containing a "<". This character
- is not allowed.
+ The target name "<" is reserved or not valid for certain CMake features,
+ such as generator expressions, and may result in undefined behavior\.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
CMake Error at BadTargetName.cmake:3 \(add_custom_target\):
- add_custom_target called with target name containing a ">". This character
- is not allowed.
+ The target name ">" is reserved or not valid for certain CMake features,
+ such as generator expressions, and may result in undefined behavior\.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/alias_targets/invalid-name-stderr.txt b/Tests/RunCMake/alias_targets/invalid-name-stderr.txt
index d33b57c..006ef37 100644
--- a/Tests/RunCMake/alias_targets/invalid-name-stderr.txt
+++ b/Tests/RunCMake/alias_targets/invalid-name-stderr.txt
@@ -1,4 +1,6 @@
-CMake Error at invalid-name.cmake:6 \(add_library\):
- add_library Invalid name for ALIAS: invalid\$name
+^CMake Error at invalid-name\.cmake:3 \(add_library\):
+ The target name "invalid\$name" is reserved or not valid for certain CMake
+ features, such as generator expressions, and may result in undefined
+ behavior\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/alias_targets/invalid-name.cmake b/Tests/RunCMake/alias_targets/invalid-name.cmake
index e2ebbfa..13e939c 100644
--- a/Tests/RunCMake/alias_targets/invalid-name.cmake
+++ b/Tests/RunCMake/alias_targets/invalid-name.cmake
@@ -1,6 +1,3 @@
-cmake_policy(SET CMP0037 OLD)
enable_language(CXX)
-
add_library(foo empty.cpp)
-
add_library(invalid$name ALIAS foo)
diff --git a/Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt
deleted file mode 100644
index 4a6f16d..0000000
--- a/Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt
+++ /dev/null
@@ -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.
diff --git a/Tests/RunCMake/cmake_minimum_required/Before24.cmake b/Tests/RunCMake/cmake_minimum_required/Before24.cmake
deleted file mode 100644
index c28fc8a..0000000
--- a/Tests/RunCMake/cmake_minimum_required/Before24.cmake
+++ /dev/null
@@ -1 +0,0 @@
-cmake_minimum_required(VERSION 2.2)
diff --git a/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt
index 5af7abb..0a796b9 100644
--- a/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt
+++ b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt
@@ -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\.
diff --git a/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake
index 0b010ef..ff23898 100644
--- a/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake
+++ b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.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)
diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt b/Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-result.txt
similarity index 100%
rename from Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt
rename to Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-result.txt
diff --git a/Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-stderr.txt b/Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-stderr.txt
new file mode 100644
index 0000000..792d314
--- /dev/null
+++ b/Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Error at BeforeVersionRemoved\.cmake:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 3\.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\)$
diff --git a/Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved.cmake b/Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved.cmake
new file mode 100644
index 0000000..acf4817
--- /dev/null
+++ b/Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved.cmake
@@ -0,0 +1 @@
+cmake_minimum_required(VERSION 2.8.12)
diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt
deleted file mode 100644
index 1363d09..0000000
--- a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt
+++ /dev/null
@@ -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.
diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake b/Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake
deleted file mode 100644
index ca0cb1d..0000000
--- a/Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_minimum_required(VERSION 2.4)
-set(CMAKE_BACKWARDS_COMPATIBILITY 2.2)
diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt
deleted file mode 100644
index 840211a..0000000
--- a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt
+++ /dev/null
@@ -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\)
diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake
deleted file mode 100644
index 62d3836..0000000
--- a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake_minimum_required(VERSION 2.4)
-cmake_policy(VERSION 2.2)
diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt b/Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-result.txt
similarity index 100%
copy from Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt
copy to Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-result.txt
diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-stderr.txt b/Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-stderr.txt
new file mode 100644
index 0000000..3628be0
--- /dev/null
+++ b/Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Error at PolicyBeforeVersionRemoved\.cmake:1 \(cmake_policy\):
+ Compatibility with CMake < 3\.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\)$
diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved.cmake b/Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved.cmake
new file mode 100644
index 0000000..01443d5
--- /dev/null
+++ b/Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION 2.8.12)
diff --git a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake
index 6de792e..cd63093 100644
--- a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake
@@ -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)
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake
index da40534..0e3cdec 100644
--- a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0009 NEW)
message(STATUS "Running CMake on GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake")
file(GLOB_RECURSE
CONTENT_LIST
diff --git a/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake b/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake
index 38c032f..f6a8e70 100644
--- a/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake
+++ b/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake
@@ -80,8 +80,6 @@
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)
diff --git a/Tests/RunCMake/include/CMP0024-WARN-result.txt b/Tests/RunCMake/include/CMP0024-WARN-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/include/CMP0024-WARN-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/include/CMP0024-WARN-stderr.txt b/Tests/RunCMake/include/CMP0024-WARN-stderr.txt
deleted file mode 100644
index 5e9f1d7..0000000
--- a/Tests/RunCMake/include/CMP0024-WARN-stderr.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-^CMake Deprecation Warning at CMP0024-WARN\.cmake:[0-9]+ \(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:[0-9]+ \(include\)
-+
-CMake Warning \(dev\) at subdir2/CMakeLists\.txt:2 \(include\):
- Policy CMP0024 is not set: Disallow include export result. Run "cmake
- --help-policy CMP0024" for policy details\. Use the cmake_policy command to
- set the policy and suppress this warning\.
-
- The file
-
- [^
-]*/Tests/RunCMake/include/CMP0024-WARN-build/subdir1/theTargets\.cmake
-
- was generated by the export\(\) command\. It should not be used as the
- argument to the include\(\) command\. Use ALIAS targets instead to refer to
- targets by alternative names\.
-
-This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/include/CMP0024-WARN.cmake b/Tests/RunCMake/include/CMP0024-WARN.cmake
deleted file mode 100644
index f267a5a..0000000
--- a/Tests/RunCMake/include/CMP0024-WARN.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_policy(VERSION 2.8.12) # Leave CMP0024 unset.
-
-enable_language(CXX)
-
-add_library(foo SHARED empty.cpp)
-
-add_subdirectory(subdir1)
-add_subdirectory(subdir2)
diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake
index f3b58c9..68a08bb 100644
--- a/Tests/RunCMake/include/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include/RunCMakeTest.cmake
@@ -2,7 +2,6 @@
run_cmake(EmptyString)
run_cmake(EmptyStringOptional)
-run_cmake(CMP0024-WARN)
run_cmake(CMP0024-NEW)
run_cmake(ExportExportInclude)
run_cmake(IncludeIsDirectory)
diff --git a/Tests/RunCMake/include_directories/CMP0021.cmake b/Tests/RunCMake/include_directories/CMP0021.cmake
index f18666b..63b1930 100644
--- a/Tests/RunCMake/include_directories/CMP0021.cmake
+++ b/Tests/RunCMake/include_directories/CMP0021.cmake
@@ -1,7 +1,5 @@
enable_language(CXX)
-cmake_policy(SET CMP0021 NEW)
-
add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>")
diff --git a/Tests/RunCMake/include_directories/incomplete-genex.cmake b/Tests/RunCMake/include_directories/incomplete-genex.cmake
index 976695a..525cf44 100644
--- a/Tests/RunCMake/include_directories/incomplete-genex.cmake
+++ b/Tests/RunCMake/include_directories/incomplete-genex.cmake
@@ -1,8 +1,5 @@
enable_language(CXX)
-cmake_policy(SET CMP0022 NEW)
-cmake_policy(SET CMP0023 NEW)
-
add_library(somelib empty.cpp)
# This test ensures that some internal mechanisms of cmGeneratorExpression
diff --git a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt
deleted file mode 100644
index 4f376d8..0000000
--- a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt
+++ /dev/null
@@ -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.$
diff --git a/Tests/RunCMake/list/GET-CMP0007-WARN.cmake b/Tests/RunCMake/list/GET-CMP0007-WARN.cmake
deleted file mode 100644
index 833f352..0000000
--- a/Tests/RunCMake/list/GET-CMP0007-WARN.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_policy(VERSION 2.4)
-set(thelist "" NEW OLD)
-
-list(GET thelist 1 thevalue)
-if (NOT thevalue STREQUAL "OLD")
- message(SEND_ERROR "returned element '${thevalue}', but expected 'OLD'")
-endif()
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
index adfe255..1b67635 100644
--- a/Tests/RunCMake/list/RunCMakeTest.cmake
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -7,7 +7,6 @@
run_cmake(NoArguments)
run_cmake(InvalidSubcommand)
-run_cmake(GET-CMP0007-WARN)
run_cmake(FILTER-REGEX-InvalidRegex)
run_cmake(GET-InvalidIndex)
diff --git a/Tests/RunCMake/project/CMP0048-NEW-stderr.txt b/Tests/RunCMake/project/CMP0048-NEW-stderr.txt
deleted file mode 100644
index b6c6b1f..0000000
--- a/Tests/RunCMake/project/CMP0048-NEW-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(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\.$
diff --git a/Tests/RunCMake/project/CMP0048-NEW.cmake b/Tests/RunCMake/project/CMP0048-NEW.cmake
index b6e80ac..dbf99a7 100644
--- a/Tests/RunCMake/project/CMP0048-NEW.cmake
+++ b/Tests/RunCMake/project/CMP0048-NEW.cmake
@@ -1,7 +1,5 @@
include(PrintVersions.cmake)
-cmake_policy(SET CMP0048 NEW)
-
project(ProjectA VERSION 1.2.3.4 LANGUAGES NONE)
print_versions(ProjectA)
diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt b/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt b/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt
deleted file mode 100644
index c11215a..0000000
--- a/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at CMP0048-OLD-VERSION.cmake:1 \(project\):
- VERSION not allowed unless CMP0048 is set to NEW
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake b/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake
deleted file mode 100644
index 6fbbe0a..0000000
--- a/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-project(MyProject VERSION 1 LANGUAGES NONE)
-message("This line not reached.")
diff --git a/Tests/RunCMake/project/CMP0048-OLD-stderr.txt b/Tests/RunCMake/project/CMP0048-OLD-stderr.txt
deleted file mode 100644
index 51e43f0..0000000
--- a/Tests/RunCMake/project/CMP0048-OLD-stderr.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(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\.
-+
-CMake Deprecation Warning at CMP0048-OLD\.cmake:1 \(cmake_policy\):
- The OLD behavior for policy CMP0048 will be removed from a future version
- of CMake\.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/project/CMP0048-OLD-stdout.txt b/Tests/RunCMake/project/CMP0048-OLD-stdout.txt
deleted file mode 100644
index 1a25c7b..0000000
--- a/Tests/RunCMake/project/CMP0048-OLD-stdout.txt
+++ /dev/null
@@ -1,2 +0,0 @@
--- PROJECT_VERSION='1'
--- MyProject_VERSION_TWEAK='0'
diff --git a/Tests/RunCMake/project/CMP0048-OLD.cmake b/Tests/RunCMake/project/CMP0048-OLD.cmake
deleted file mode 100644
index 6c32d2c..0000000
--- a/Tests/RunCMake/project/CMP0048-OLD.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_policy(SET CMP0048 OLD)
-set(PROJECT_VERSION 1)
-set(MyProject_VERSION_TWEAK 0)
-project(MyProject NONE)
-message(STATUS "PROJECT_VERSION='${PROJECT_VERSION}'")
-message(STATUS "MyProject_VERSION_TWEAK='${MyProject_VERSION_TWEAK}'")
diff --git a/Tests/RunCMake/project/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project/CMP0048-WARN-stderr.txt
deleted file mode 100644
index d9be5d3..0000000
--- a/Tests/RunCMake/project/CMP0048-WARN-stderr.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-CMake Warning \(dev\) at CMP0048-WARN.cmake:3 \(project\):
- Policy CMP0048 is not set: project\(\) command manages VERSION variables.
- Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The following variable\(s\) would be set to empty:
-
- PROJECT_VERSION
- MyProject_VERSION_TWEAK
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/project/CMP0048-WARN.cmake b/Tests/RunCMake/project/CMP0048-WARN.cmake
deleted file mode 100644
index 97359e6..0000000
--- a/Tests/RunCMake/project/CMP0048-WARN.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(PROJECT_VERSION 1)
-set(MyProject_VERSION_TWEAK 0)
-project(MyProject NONE)
diff --git a/Tests/RunCMake/project/CMP0096-NEW.cmake b/Tests/RunCMake/project/CMP0096-NEW.cmake
index e2cdd20..2aa0468 100644
--- a/Tests/RunCMake/project/CMP0096-NEW.cmake
+++ b/Tests/RunCMake/project/CMP0096-NEW.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0096 NEW)
include(CMP0096-common.cmake)
diff --git a/Tests/RunCMake/project/CMP0096-OLD.cmake b/Tests/RunCMake/project/CMP0096-OLD.cmake
index 25a3b19..15e5140 100644
--- a/Tests/RunCMake/project/CMP0096-OLD.cmake
+++ b/Tests/RunCMake/project/CMP0096-OLD.cmake
@@ -1,3 +1,2 @@
-cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0096 OLD)
include(CMP0096-common.cmake)
diff --git a/Tests/RunCMake/project/CMP0096-WARN.cmake b/Tests/RunCMake/project/CMP0096-WARN.cmake
index 7fe0861..65b0d6e 100644
--- a/Tests/RunCMake/project/CMP0096-WARN.cmake
+++ b/Tests/RunCMake/project/CMP0096-WARN.cmake
@@ -1,3 +1 @@
-cmake_policy(SET CMP0048 NEW)
-
include(CMP0096-common.cmake)
diff --git a/Tests/RunCMake/project/CMakeLists.txt b/Tests/RunCMake/project/CMakeLists.txt
index 28146c4..854b404 100644
--- a/Tests/RunCMake/project/CMakeLists.txt
+++ b/Tests/RunCMake/project/CMakeLists.txt
@@ -1,7 +1,5 @@
if("x${RunCMake_TEST}" STREQUAL "xNoMinimumRequired")
# No cmake_minimum_required(VERSION)
-elseif(RunCMake_TEST MATCHES "^CMP0048")
- cmake_minimum_required(VERSION 2.8.12) # old enough to not set CMP0048
else()
cmake_minimum_required(VERSION 3.10)
# CMP0180 needs to be set before the project() call for these tests
diff --git a/Tests/RunCMake/project/ProjectDescription.cmake b/Tests/RunCMake/project/ProjectDescription.cmake
index 3a47362..47bd8c5 100644
--- a/Tests/RunCMake/project/ProjectDescription.cmake
+++ b/Tests/RunCMake/project/ProjectDescription.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" LANGUAGES)
if(NOT PROJECT_DESCRIPTION)
message(FATAL_ERROR "PROJECT_DESCRIPTION expected to be set")
diff --git a/Tests/RunCMake/project/ProjectDescription2.cmake b/Tests/RunCMake/project/ProjectDescription2.cmake
index 3f186ba..36b8ef1 100644
--- a/Tests/RunCMake/project/ProjectDescription2.cmake
+++ b/Tests/RunCMake/project/ProjectDescription2.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" DESCRIPTION "Only once allowed" LANGUAGES)
diff --git a/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake b/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake
index 25acff8..76d1051 100644
--- a/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake
+++ b/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectDescriptionTest VERSION 1.0.0 LANGUAGES NONE DESCRIPTION)
diff --git a/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake b/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake
index f50a2f6..ed09af4 100644
--- a/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake
+++ b/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION LANGUAGES NONE)
diff --git a/Tests/RunCMake/project/ProjectHomepage.cmake b/Tests/RunCMake/project/ProjectHomepage.cmake
index 3307f1f..140b2bb 100644
--- a/Tests/RunCMake/project/ProjectHomepage.cmake
+++ b/Tests/RunCMake/project/ProjectHomepage.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectHomepageTest VERSION 1.0.0 HOMEPAGE_URL "http://example.com" LANGUAGES)
if(NOT PROJECT_HOMEPAGE_URL)
message(FATAL_ERROR "PROJECT_HOMEPAGE_URL expected to be set")
diff --git a/Tests/RunCMake/project/ProjectHomepage2-stderr.txt b/Tests/RunCMake/project/ProjectHomepage2-stderr.txt
index 4a0adc2..fe22263 100644
--- a/Tests/RunCMake/project/ProjectHomepage2-stderr.txt
+++ b/Tests/RunCMake/project/ProjectHomepage2-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Error at ProjectHomepage2.cmake:2 \(project\):
+^CMake Error at ProjectHomepage2.cmake:[0-9]+ \(project\):
HOMEPAGE_URL may be specified at most once.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/project/ProjectHomepage2.cmake b/Tests/RunCMake/project/ProjectHomepage2.cmake
index 184c392..28b8ae7 100644
--- a/Tests/RunCMake/project/ProjectHomepage2.cmake
+++ b/Tests/RunCMake/project/ProjectHomepage2.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectDescriptionTest VERSION 1.0.0 HOMEPAGE_URL "http://example.com" HOMEPAGE_URL "http://example.com" LANGUAGES)
diff --git a/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt b/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt
index c9503b7..b1823ee 100644
--- a/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt
+++ b/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Warning at ProjectHomepageNoArg.cmake:2 \(project\):
+^CMake Warning at ProjectHomepageNoArg.cmake:[0-9]+ \(project\):
HOMEPAGE_URL keyword not followed by a value or was followed by a value
that expanded to nothing.
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/project/ProjectHomepageNoArg.cmake b/Tests/RunCMake/project/ProjectHomepageNoArg.cmake
index 4605541..4be2fbf 100644
--- a/Tests/RunCMake/project/ProjectHomepageNoArg.cmake
+++ b/Tests/RunCMake/project/ProjectHomepageNoArg.cmake
@@ -1,2 +1 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectDescriptionTest VERSION 1.0.0 LANGUAGES NONE HOMEPAGE_URL)
diff --git a/Tests/RunCMake/project/ProjectTwice.cmake b/Tests/RunCMake/project/ProjectTwice.cmake
index d053834..66dcb9f 100644
--- a/Tests/RunCMake/project/ProjectTwice.cmake
+++ b/Tests/RunCMake/project/ProjectTwice.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectTwiceTestFirst
VERSION 1.2.3.4
DESCRIPTION "Test Project"
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
index 554cdff..11f2b02 100644
--- a/Tests/RunCMake/project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -53,9 +53,6 @@
run_cmake(VersionTwice)
run_cmake(VersionMax)
-run_cmake(CMP0048-OLD)
-run_cmake(CMP0048-OLD-VERSION)
-run_cmake(CMP0048-WARN)
run_cmake(CMP0048-NEW)
run_cmake(CMP0096-WARN)
diff --git a/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake b/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake
index d6056ce..610d8c2 100644
--- a/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake
+++ b/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectA VERSION 1 LANGUAGES NONE)
get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
message(STATUS "ENABLED_LANGUAGES='${langs}'")
diff --git a/Tests/RunCMake/project/VersionEmpty.cmake b/Tests/RunCMake/project/VersionEmpty.cmake
index 0cfb291..93993f6 100644
--- a/Tests/RunCMake/project/VersionEmpty.cmake
+++ b/Tests/RunCMake/project/VersionEmpty.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
set(PROJECT_VERSION 1)
project(ProjectA VERSION "" LANGUAGES NONE)
get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
diff --git a/Tests/RunCMake/project/VersionInvalid-stderr.txt b/Tests/RunCMake/project/VersionInvalid-stderr.txt
index e13a382..f5b9ccf 100644
--- a/Tests/RunCMake/project/VersionInvalid-stderr.txt
+++ b/Tests/RunCMake/project/VersionInvalid-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at VersionInvalid.cmake:2 \(project\):
+CMake Error at VersionInvalid.cmake:[0-9]+ \(project\):
VERSION "NONE" format invalid.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/project/VersionInvalid.cmake b/Tests/RunCMake/project/VersionInvalid.cmake
index 8d5dd7f..fbb11e2 100644
--- a/Tests/RunCMake/project/VersionInvalid.cmake
+++ b/Tests/RunCMake/project/VersionInvalid.cmake
@@ -1,3 +1,2 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectA VERSION NONE)
message("This line not reached.")
diff --git a/Tests/RunCMake/project/VersionMax.cmake b/Tests/RunCMake/project/VersionMax.cmake
index e955364..1368681 100644
--- a/Tests/RunCMake/project/VersionMax.cmake
+++ b/Tests/RunCMake/project/VersionMax.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0096 OLD)
enable_language(C)
diff --git a/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt b/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt
index 63cbf63..b169965 100644
--- a/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt
+++ b/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at VersionMissingLanguages.cmake:2 \(project\):
+CMake Error at VersionMissingLanguages.cmake:[0-9]+ \(project\):
project with VERSION, DESCRIPTION or HOMEPAGE_URL must use LANGUAGES before
language names.
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/project/VersionMissingLanguages.cmake b/Tests/RunCMake/project/VersionMissingLanguages.cmake
index dc41514..72d29f0 100644
--- a/Tests/RunCMake/project/VersionMissingLanguages.cmake
+++ b/Tests/RunCMake/project/VersionMissingLanguages.cmake
@@ -1,3 +1,2 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectA VERSION 1 NONE)
message("This line not reached.")
diff --git a/Tests/RunCMake/project/VersionMissingValueOkay.cmake b/Tests/RunCMake/project/VersionMissingValueOkay.cmake
index 1fb1437..3a6cf6f 100644
--- a/Tests/RunCMake/project/VersionMissingValueOkay.cmake
+++ b/Tests/RunCMake/project/VersionMissingValueOkay.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0048 NEW)
set(PROJECT_VERSION 1)
project(ProjectA VERSION LANGUAGES NONE)
get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
diff --git a/Tests/RunCMake/project/VersionTwice-stderr.txt b/Tests/RunCMake/project/VersionTwice-stderr.txt
index dc05533..9fa87a8 100644
--- a/Tests/RunCMake/project/VersionTwice-stderr.txt
+++ b/Tests/RunCMake/project/VersionTwice-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at VersionTwice.cmake:2 \(project\):
+CMake Error at VersionTwice.cmake:[0-9]+ \(project\):
VERSION may be specified at most once.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/project/VersionTwice.cmake b/Tests/RunCMake/project/VersionTwice.cmake
index dc0c996..5f60999 100644
--- a/Tests/RunCMake/project/VersionTwice.cmake
+++ b/Tests/RunCMake/project/VersionTwice.cmake
@@ -1,3 +1,2 @@
-cmake_policy(SET CMP0048 NEW)
project(ProjectA VERSION 1 VERSION)
message("This line not reached.")
diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt
deleted file mode 100644
index 38ec91f..0000000
--- a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-^CMake Warning \(dev\) in CMakeLists\.txt:
- No project\(\) command is present. The top-level CMakeLists.txt file must
- contain a literal, direct call to the project\(\) command. Add a line of
- code such as
-
- project\(ProjectName\)
-
- near the top of the file, but after cmake_minimum_required\(\).
-
- CMake is pretending there is a "project\(Project\)" command on the first
- line\.
-This warning is for project developers. Use -Wno-dev to suppress it\.
-+
-CMake Deprecation Warning at CMakeLists\.txt: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\.$
diff --git a/Tests/RunCMake/project_injected/CMakeLists.txt b/Tests/RunCMake/project_injected/CMakeLists.txt
index 1b4931b..dc4c49f 100644
--- a/Tests/RunCMake/project_injected/CMakeLists.txt
+++ b/Tests/RunCMake/project_injected/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12.2) # old enough to not set CMP0048
+cmake_minimum_required(VERSION 3.10)
# no project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/project_injected/Inject-stderr.txt b/Tests/RunCMake/project_injected/Inject-stderr.txt
new file mode 100644
index 0000000..c6533b3
--- /dev/null
+++ b/Tests/RunCMake/project_injected/Inject-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Warning \(dev\) in CMakeLists\.txt:
+ No project\(\) command is present. The top-level CMakeLists.txt file must
+ contain a literal, direct call to the project\(\) command. Add a line of
+ code such as
+
+ project\(ProjectName\)
+
+ near the top of the file, but after cmake_minimum_required\(\).
+
+ CMake is pretending there is a "project\(Project\)" command on the first
+ line\.
+This warning is for project developers. Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN.cmake b/Tests/RunCMake/project_injected/Inject.cmake
similarity index 100%
rename from Tests/RunCMake/project_injected/CMP0048-WARN.cmake
rename to Tests/RunCMake/project_injected/Inject.cmake
diff --git a/Tests/RunCMake/project_injected/RunCMakeTest.cmake b/Tests/RunCMake/project_injected/RunCMakeTest.cmake
index cf63e12..9410b3d 100644
--- a/Tests/RunCMake/project_injected/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project_injected/RunCMakeTest.cmake
@@ -9,5 +9,5 @@
-DCMAKE_PROJECT_VERSION_MINOR:STATIC=2
-DCMAKE_PROJECT_VERSION_PATCH:STATIC=3
)
-run_cmake(CMP0048-WARN)
+run_cmake(Inject)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt
index 12c00fb..02c2870 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt
@@ -1,11 +1,11 @@
-CMake Error at CMP0023-NEW-2.cmake:11 \(target_link_libraries\):
+CMake Error at CMP0023-NEW-2.cmake:9 \(target_link_libraries\):
The plain signature for target_link_libraries has already been used with
the target "foo". All uses of target_link_libraries with a target must be
either all-keyword or all-plain.
The uses of the plain signature are here:
- \* CMP0023-NEW-2.cmake:10 \(target_link_libraries\)
+ \* CMP0023-NEW-2.cmake:8 \(target_link_libraries\)
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2.cmake
index f87a684..0f50eb6 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2.cmake
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2.cmake
@@ -1,8 +1,6 @@
enable_language(CXX)
-cmake_policy(SET CMP0023 NEW)
-
add_library(foo SHARED empty_vs6_1.cpp)
add_library(bar SHARED empty_vs6_2.cpp)
add_library(bat SHARED empty_vs6_3.cpp)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt
index 117c806..7c5869a 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt
@@ -1,11 +1,11 @@
-CMake Error at CMP0023-NEW.cmake:11 \(target_link_libraries\):
+CMake Error at CMP0023-NEW.cmake:9 \(target_link_libraries\):
The plain signature for target_link_libraries has already been used with
the target "foo". All uses of target_link_libraries with a target must be
either all-keyword or all-plain.
The uses of the plain signature are here:
- \* CMP0023-NEW.cmake:10 \(target_link_libraries\)
+ \* CMP0023-NEW.cmake:8 \(target_link_libraries\)
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-NEW.cmake
index 211029b..45ea41e 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW.cmake
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW.cmake
@@ -1,8 +1,6 @@
enable_language(CXX)
-cmake_policy(SET CMP0023 NEW)
-
add_library(foo SHARED empty_vs6_1.cpp)
add_library(bar SHARED empty_vs6_2.cpp)
add_library(bat SHARED empty_vs6_3.cpp)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt
deleted file mode 100644
index 7e49d52..0000000
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-CMake Warning \(dev\) at CMP0023-WARN-2.cmake:9 \(target_link_libraries\):
- Policy CMP0023 is not set: Plain and keyword target_link_libraries
- signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The plain signature for target_link_libraries has already been used with
- the target "foo". All uses of target_link_libraries with a target should
- be either all-keyword or all-plain.
-
- The uses of the plain signature are here:
-
- \* CMP0023-WARN-2.cmake:8 \(target_link_libraries\)
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake
deleted file mode 100644
index a175a61..0000000
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-cmake_policy(VERSION 2.8.11)
-enable_language(CXX)
-
-add_library(foo SHARED empty_vs6_1.cpp)
-add_library(bar SHARED empty_vs6_2.cpp)
-add_library(bat SHARED empty_vs6_3.cpp)
-
-target_link_libraries(foo bar)
-target_link_libraries(foo LINK_PRIVATE bat)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt
deleted file mode 100644
index df1288e..0000000
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-CMake Warning \(dev\) at CMP0023-WARN.cmake:9 \(target_link_libraries\):
- Policy CMP0023 is not set: Plain and keyword target_link_libraries
- signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- The plain signature for target_link_libraries has already been used with
- the target "foo". All uses of target_link_libraries with a target should
- be either all-keyword or all-plain.
-
- The uses of the plain signature are here:
-
- \* CMP0023-WARN.cmake:8 \(target_link_libraries\)
-
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake
deleted file mode 100644
index 7fbb70e..0000000
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-cmake_policy(VERSION 2.8.11)
-enable_language(CXX)
-
-add_library(foo SHARED empty_vs6_1.cpp)
-add_library(bar SHARED empty_vs6_2.cpp)
-add_library(bat SHARED empty_vs6_3.cpp)
-
-target_link_libraries(foo bar)
-target_link_libraries(foo PRIVATE bat)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
index 488ae8d..52fab24 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Error at CMP0079-link-NEW-bogus\.cmake:6 \(set_property\):
+^CMake Error at CMP0079-link-NEW-bogus\.cmake:[0-9]+ \(set_property\):
Target "top" links to:
::@\(0xdeadbeef\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake
index 8932521..84f280a 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0028 NEW)
cmake_policy(SET CMP0079 NEW)
enable_language(C)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
index 07a3490..b3c363c 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
@@ -1,7 +1,3 @@
-
-cmake_policy (SET CMP0038 NEW)
-cmake_policy (SET CMP0042 NEW)
-
enable_language(C)
add_library(foo SHARED lib.c)
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index 80be692..76c06f1 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -8,9 +8,7 @@
run_cmake(ConfigCase)
unset(RunCMake_TEST_OPTIONS)
-run_cmake(CMP0023-WARN)
run_cmake(CMP0023-NEW)
-run_cmake(CMP0023-WARN-2)
run_cmake(CMP0023-NEW-2)
run_cmake(CMP0079-iface-WARN)
run_cmake(CMP0079-iface-OLD)
diff --git a/Tests/RunCMake/target_sources/CMP0026-LOCATION-result.txt b/Tests/RunCMake/target_sources/CMP0026-LOCATION-result.txt
deleted file mode 100644
index 573541a..0000000
--- a/Tests/RunCMake/target_sources/CMP0026-LOCATION-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/Tests/RunCMake/target_sources/CMP0026-LOCATION-stderr.txt b/Tests/RunCMake/target_sources/CMP0026-LOCATION-stderr.txt
deleted file mode 100644
index d7ccedb..0000000
--- a/Tests/RunCMake/target_sources/CMP0026-LOCATION-stderr.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-^CMake Deprecation Warning at CMP0026-LOCATION.cmake:[0-9]+ \(cmake_policy\):
- The OLD behavior for policy CMP0026 will be removed from a future version
- of CMake.
-
- The cmake-policies\(7\) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/target_sources/CMP0026-LOCATION.cmake b/Tests/RunCMake/target_sources/CMP0026-LOCATION.cmake
deleted file mode 100644
index 642856c..0000000
--- a/Tests/RunCMake/target_sources/CMP0026-LOCATION.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-
-cmake_policy(SET CMP0026 OLD)
-enable_language(CXX)
-
-add_library(objlib OBJECT
- empty_1.cpp
-)
-
-add_executable(my_exe
- empty_2.cpp
- $<TARGET_OBJECTS:objlib>
-)
-
-get_target_property( loc my_exe LOCATION)
diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake
index 4d3d4fe..1fe9427 100644
--- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake
@@ -6,7 +6,6 @@
run_cmake(EmptyKeywordArgs)
run_cmake(OriginDebug)
-run_cmake(CMP0026-LOCATION)
run_cmake(CMP0076-OLD)
run_cmake(CMP0076-WARN)
run_cmake(MissingSource)
diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt
index 45ee858..e9c1c1a 100644
--- a/Tests/Testing/CMakeLists.txt
+++ b/Tests/Testing/CMakeLists.txt
@@ -30,10 +30,6 @@
# Extra coverage
#
build_command(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM})
-block(SCOPE_FOR POLICIES)
-cmake_policy(VERSION 2.8.12) # old enough to not set CMP0036
-build_name(BUILD_NAME_VAR)
-endblock()
site_name(SITE_NAME_VAR)
#
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
index 0e106a4..be6154c 100644
--- a/Tests/VSResource/CMakeLists.txt
+++ b/Tests/VSResource/CMakeLists.txt
@@ -56,10 +56,3 @@
set_property(TARGET VSResource
PROPERTY VS_GLOBAL_CMakeTestVsGlobalVariable "test val")
-
-if(CMAKE_GENERATOR MATCHES "Ninja|Visual Studio")
- cmake_policy(PUSH)
- cmake_policy(SET CMP0037 OLD)
- add_library("My ResourceLib" lib.cpp lib.rc)
- cmake_policy(POP)
-endif()
diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt
index 69614f4..1573738 100644
--- a/Tests/Wrapping/CMakeLists.txt
+++ b/Tests/Wrapping/CMakeLists.txt
@@ -96,15 +96,3 @@
add_executable(wrapFLTK wrapFLTK.cxx ${wrapFLTK_FLTK_UI_SRCS})
target_link_libraries(wrapFLTK wraplibFLTK)
add_dependencies(wrapFLTK fakefluid)
-
-#
-# Mangled Mesa
-#
-configure_file(
- ${Wrapping_SOURCE_DIR}/dummy
- ${Wrapping_BINARY_DIR}/gl.h
- COPYONLY)
-block(SCOPE_FOR POLICIES)
-cmake_policy(VERSION 2.8.12) # old enough to not set CMP0030
-use_mangled_mesa (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa)
-endblock()
diff --git a/Tests/Wrapping/dummy b/Tests/Wrapping/dummy
deleted file mode 100644
index e69de29..0000000
--- a/Tests/Wrapping/dummy
+++ /dev/null