1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-17 15:32:10 +08:00

FindPython: ensure user's policies are respected

Do not set the policy version before recording our internal macros such
as `__Python_add_library`.  Otherwise callers get our policy version
instead of theirs.  Instead just set the specific policies we need.

Also fix one case in our test suite where we were accidentally
relying on the policy version to be set by `FindPython`.

Fixes: #21042
This commit is contained in:
Marc Chevrier
2020-08-04 16:40:50 +02:00
committed by Brad King
parent 63a65baf4c
commit a92d384548
2 changed files with 6 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
if (PYTHON_MUST_NOT_BE_FOUND)
find_package(${PYTHON_PACKAGE_NAME} QUIET)
if (${PYTHON_PACKAGE_NAME}_FOUND)