diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index db2596ca9d..6473aa7b9b 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -100,7 +100,7 @@ Policies Introduced by CMake 4.2 CMP0203: _WINDLL is defined for shared libraries targeting the MSVC ABI. CMP0202: PDB file names always include their target's per-config POSTFIX. - CMP0201: The Python::NumPy target does not depend on the Python::Module target. + CMP0201: Python::NumPy does not depend on Python::Development.Module. CMP0200: Location and configuration selection for imported targets is more consistent. CMP0199: $ only matches the configuration of the consumed target. CMP0198: CMAKE_PARENT_LIST_FILE is not defined in CMakeLists.txt. diff --git a/Help/policy/CMP0201.rst b/Help/policy/CMP0201.rst index f098cdeb73..d2c5f2169c 100644 --- a/Help/policy/CMP0201.rst +++ b/Help/policy/CMP0201.rst @@ -3,32 +3,26 @@ CMP0201 .. versionadded:: 4.2 -The modules :module:`FindPython3`, :module:`FindPython2` and -:module:`FindPython` change the handling of the ``NumPy`` -component and, respectively, the definition of the ``Python3::NumPy``, -``Python2::NumPy`` and ``Python::NumPy`` targets. +``Python::NumPy`` does not depend on ``Python::Development.Module``. -For CMake 4.2 and above, the specification of the ``NumPy`` component does not -imply anymore the component ``Development.Module`` and the ``Python3::NumPy``, -``Python2::NumPy`` and ``Python::NumPy`` targets provided, respectively, by the -modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` -do not depend on the ``Python3::Development.Module``, -``Python2::Development.Module`` and ``Python::Development.Module`` targets. -For CMake 4.1 and below, the specification of the ``NumPy`` component imply the -component ``Development.Module`` and the ``Python3::NumPy``, ``Python2::NumPy`` -and ``Python::NumPy`` targets provided, respectively, by the modules -:module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` depend on -the ``Python3::Development.Module``, ``Python2::Development.Module`` and -``Python::Development.Module`` targets. - -The ``OLD`` behavior for this policy creates a dependency of the ``NumPy`` -target over the ``Development.Module`` target. The ``NEW`` behavior does not -create a dependency of the ``NumPy`` target over the ``Development.Module`` -target. +:module:`FindPython3`, :module:`FindPython2`, and :module:`FindPython` provide +``Python{3,2,}::NumPy`` and ``Python{3,2,}::Development.Module`` targets when +the corresponding components are requested. +In CMake 4.1 and below, requesting the ``NumPy`` component implies the +``Development.Module`` component, and the provided ``Python{3,2,}::NumPy`` +targets depend on the provided ``Python{3,2,}::Development.Module`` targets. +This dependency is not necessary. +In CMake 4.2 and above, requesting the ``NumPy`` component does not imply the +``Development.Module`` component, and the provided ``Python{3,2,}::NumPy`` +targets do not depend on the provided ``Python{3,2,}::Development.Module`` +targets. This policy provides compatibility with projects that expect the legacy behavior. +The ``OLD`` behavior for this policy makes ``NumPy`` depend on +``Development.Module``. The ``NEW`` behavior for this policy does not. + .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.2 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn .. include:: include/STANDARD_ADVICE.rst diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index dc4c48acf7..425066120c 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -602,9 +602,8 @@ class cmMakefile; "consistent.", \ 4, 2, 0, WARN) \ SELECT(POLICY, CMP0201, \ - "The Python::NumPy target does not depend on the Python::Module " \ - "target.", \ - 4, 2, 0, WARN) \ + "Python::NumPy does not depend on Python::Development.Module.", 4, \ + 2, 0, WARN) \ SELECT(POLICY, CMP0202, \ "PDB file names always include their target's per-config POSTFIX.", \ 4, 2, 0, WARN) \