FindCABLE: Add policy to remove this module

CABLE has not been maintained in a long time.
This commit is contained in:
Brad King
2025-03-26 11:24:30 -04:00
parent 3c2ed4bbc6
commit 2b8b17106c
24 changed files with 125 additions and 2 deletions

View File

@@ -112,7 +112,6 @@ They are normally called through the :command:`find_package` command.
/module/FindBLAS
/module/FindBullet
/module/FindBZip2
/module/FindCABLE
/module/FindCoin3D
/module/FindCUDAToolkit
/module/FindCups
@@ -289,6 +288,7 @@ Deprecated Find Modules
:maxdepth: 1
/module/FindBoost
/module/FindCABLE
/module/FindCUDA
/module/FindDart
/module/FindGCCXML

View File

@@ -98,6 +98,7 @@ Policies Introduced by CMake 4.1
.. toctree::
:maxdepth: 1
CMP0191: The FindCABLE module is removed. </policy/CMP0191>
CMP0190: FindPython enforce consistency in cross-compiling mode. </policy/CMP0190>
CMP0189: TARGET_PROPERTY evaluates LINK_LIBRARIES properties transitively. </policy/CMP0189>
CMP0188: The FindGCCXML module is removed. </policy/CMP0188>

21
Help/policy/CMP0191.rst Normal file
View File

@@ -0,0 +1,21 @@
CMP0191
-------
.. versionadded:: 4.1
The :module:`FindCABLE` module is removed.
CMake 4.0 and below provide the :module:`FindCABLE` module, but the CABLE
tool is no longer maintained. CMake 4.1 and above prefer to not provide
the :module:`FindCABLE` module. This policy provides compatibility for
projects that have not been ported away from it.
The ``OLD`` behavior of this policy is for ``find_package(CABLE)`` to load
the deprecated module. The ``NEW`` behavior is for ``find_package(CABLE)``
to fail as if the module does not exist.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt

View File

@@ -0,0 +1,5 @@
remove-FindCABLE
-----------------
* The :module:`FindCABLE` module has been deprecated via policy
:policy:`CMP0191`.

View File

@@ -5,6 +5,9 @@
FindCABLE
---------
.. versionchanged:: 4.1
This module is available only if policy :policy:`CMP0191` is not set to ``NEW``.
Finds the CABLE installation and determines its include paths and libraries.
Package called CABLE (CABLE Automates Bindings for Language Extension) was
@@ -44,6 +47,16 @@ directories:
target_include_directories(tcl_wrapper_target PRIVATE ${CABLE_INCLUDE_DIR})
#]=======================================================================]
cmake_policy(GET CMP0191 _FindCABLE_CMP0191)
if(_FindCABLE_CMP0191 STREQUAL "NEW")
message(FATAL_ERROR "The FindCABLE module has been removed by policy CMP0191.")
endif()
if(_FindCABLE_testing)
set(_FindCABLE_included TRUE)
return()
endif()
if(NOT CABLE)
find_path(CABLE_BUILD_DIR cableVersion.h)
endif()

View File

@@ -530,6 +530,7 @@ cmFindPackageCommand::cmFindPackageCommand(cmExecutionStatus& status)
this->AppendSearchPathGroups();
this->DeprecatedFindModules["Boost"] = cmPolicies::CMP0167;
this->DeprecatedFindModules["CABLE"] = cmPolicies::CMP0191;
this->DeprecatedFindModules["CUDA"] = cmPolicies::CMP0146;
this->DeprecatedFindModules["Dart"] = cmPolicies::CMP0145;
this->DeprecatedFindModules["GCCXML"] = cmPolicies::CMP0188;

View File

@@ -23,6 +23,7 @@ bool cmIncludeCommand(std::vector<std::string> const& args,
DeprecatedModules["Dart"] = cmPolicies::CMP0145;
DeprecatedModules["Documentation"] = cmPolicies::CMP0106;
DeprecatedModules["FindBoost"] = cmPolicies::CMP0167;
DeprecatedModules["FindCABLE"] = cmPolicies::CMP0191;
DeprecatedModules["FindCUDA"] = cmPolicies::CMP0146;
DeprecatedModules["FindDart"] = cmPolicies::CMP0145;
DeprecatedModules["FindGCCXML"] = cmPolicies::CMP0188;

View File

@@ -569,7 +569,8 @@ class cmMakefile;
4, 1, 0, WARN) \
SELECT(POLICY, CMP0190, \
"FindPython enforce consistency in cross-compiling mode.", 4, 1, 0, \
WARN)
WARN) \
SELECT(POLICY, CMP0191, "The FindCABLE module is removed.", 4, 1, 0, WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \

View File

@@ -0,0 +1,4 @@
^CMake Warning at CMP0191-NEW\.cmake:[0-9]+ \(find_package\):
No "FindCABLE\.cmake" found in CMAKE_MODULE_PATH\.
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)

View File

@@ -0,0 +1,7 @@
cmake_policy(SET CMP0191 NEW)
set(_FindCABLE_testing TRUE)
find_package(CABLE MODULE)
if(_FindCABLE_included)
message(FATAL_ERROR "FindCABLE.cmake erroneously included")
endif()

View File

@@ -0,0 +1,7 @@
cmake_policy(SET CMP0191 OLD)
set(_FindCABLE_testing TRUE)
find_package(CABLE MODULE)
if(NOT _FindCABLE_included)
message(FATAL_ERROR "FindCABLE.cmake not included")
endif()

View File

@@ -0,0 +1,8 @@
CMake Warning \(dev\) at CMP0191-WARN\.cmake:[0-9]+ \(find_package\):
Policy CMP0191 is not set: The FindCABLE module is removed\. Run "cmake
--help-policy CMP0191" 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\.$

View File

@@ -0,0 +1,6 @@
set(_FindCABLE_testing TRUE)
find_package(CABLE MODULE)
if(NOT _FindCABLE_included)
message(FATAL_ERROR "FindCABLE.cmake not included")
endif()

View File

@@ -64,6 +64,9 @@ run_cmake(CMP0167-NEW)
run_cmake(CMP0188-OLD)
run_cmake(CMP0188-WARN)
run_cmake(CMP0188-NEW)
run_cmake(CMP0191-OLD)
run_cmake(CMP0191-WARN)
run_cmake(CMP0191-NEW)
run_cmake(WrongVersionRange)
run_cmake(EmptyVersionRange)
run_cmake(VersionRangeWithEXACT)

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1,6 @@
^CMake Error at CMP0191-NEW-name\.cmake:[0-9]+ \(include\):
include could not find requested file:
FindCABLE
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)$

View File

@@ -0,0 +1,2 @@
cmake_policy(SET CMP0191 NEW)
include(FindCABLE)

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1,6 @@
^CMake Error at [^
]*/Modules/FindCABLE.cmake:[0-9]+ \(message\):
The FindCABLE module has been removed by policy CMP0191\.
Call Stack \(most recent call first\):
CMP0191-NEW-path\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)$

View File

@@ -0,0 +1,2 @@
cmake_policy(SET CMP0191 NEW)
include(${CMAKE_ROOT}/Modules/FindCABLE.cmake)

View File

@@ -0,0 +1,7 @@
cmake_policy(SET CMP0191 OLD)
set(_FindCABLE_testing 1)
include(FindCABLE)
if(NOT _FindCABLE_included)
message(FATAL_ERROR "FindCABLE.cmake not included")
endif()

View File

@@ -0,0 +1,8 @@
^CMake Warning \(dev\) at CMP0191-WARN\.cmake:[0-9]+ \(include\):
Policy CMP0191 is not set: The FindCABLE module is removed\. Run "cmake
--help-policy CMP0191" 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\.$

View File

@@ -0,0 +1,7 @@
# Do not set CMP0191.
set(_FindCABLE_testing 1)
include(FindCABLE)
if(NOT _FindCABLE_included)
message(FATAL_ERROR "FindCABLE.cmake not included")
endif()

View File

@@ -30,3 +30,8 @@ run_cmake(CMP0188-OLD)
run_cmake(CMP0188-WARN)
run_cmake(CMP0188-NEW-name)
run_cmake(CMP0188-NEW-path)
run_cmake(CMP0191-OLD)
run_cmake(CMP0191-WARN)
run_cmake(CMP0191-NEW-name)
run_cmake(CMP0191-NEW-path)