]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake: update FindPython3 module
authorKefu Chai <tchaikov@gmail.com>
Mon, 14 Aug 2023 15:27:42 +0000 (23:27 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 17 Aug 2023 02:16:45 +0000 (10:16 +0800)
commitfb93d6e03208934555f7467da45179ea62b65c4c
treeeeeb8e1e93700865cf30220742446e76a5044261
parent9545e578a47ae78d477143faed8ca1329d956644
cmake: update FindPython3 module

* use the one shiped by the latest CMake (ab379e5054aa792df9572078dcf95bddd75f7661)
* use the new policy to use the new find strategy.
* accomodate the vanilla FindPython3 module to Ceph by:
  - dropping the `cmake_policy()` calls which set the policy not supported
    by 3.16.
  - `include (FindPackageHandleStandardArgs)` without specifying the
    relative path.
  - dropping the `HANDLE_VERSION_RANGE` from `FindPackageHandleStandardArgs()` call.
    this option was introduced by CMake v3.19, see
    https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html
    but Ubuntu focal comes with CMake 3.16, which is our minimal required CMake version.

the new FindPython3 module from CMake:

* enables us to find the recent Python intepreter and development files up to
  CPython 3.13.
* finds intepreter with the new `Python_FIND_STRATEGY`. the old and default
  strategy always finds the most recent version with all specified name
  and in all locations. so, if /usr/bin/python exists, it would accept, even
  if it is  a symlink to python3.9 and what we want is python3.6. while
  the new policy stops at the one which satisfies the constraints.
  simpler this way and less error prone.

Fixes: https://tracker.ceph.com/issues/62428
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
CMakeLists.txt
COPYING
cmake/modules/FindPython/Support.cmake
cmake/modules/FindPython3.cmake