Skip to content

Commit c06cad0

Browse files
committed
docs: upgrade guide CMake suggestions
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 92f3688 commit c06cad0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/upgrade.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ pybind11 v3.0 are not ABI-compatible with those built using v2.12. To ensure
2424
cross-extension-module compatibility, it is recommended to rebuild all
2525
pybind11-based extensions with v3.0.
2626

27+
CMake support now defaults to the modern FindPython module. If you haven't
28+
moved, we do some some backward compatibility ``PYTHON_*`` variables, but
29+
please update to using ``Python_*`` variables (and setting ``PYTHON_*``
30+
variables will not affect the build anymore).
31+
2732
A major new feature in this release is the integration of
2833
``py::smart_holder``, which improves support for ``std::unique_ptr``
2934
and ``std::shared_ptr``, resolving several long-standing issues. See
@@ -76,6 +81,11 @@ you may incrementally adopt new features where appropriate:
7681
There is no urgency to refactor existing, working bindings — adopt new
7782
features as the need arises or as part of ongoing maintenance efforts.
7883

84+
If you are using CMake, update to FindPython variables (mostly changing
85+
variables from ``PYTHON_*`` -> ``Python_*``). You should see if you can use
86+
``set(PYBIND11_FINDPYTHON ON)``, which has been supported for years and will
87+
avoid setting the compatibly mode variables.
88+
7989
Potential stumbling blocks when migrating to v3.0
8090
-------------------------------------------------
8191

0 commit comments

Comments
 (0)