set policy 0148 explicitly

Currently, there is an warning when CMake >= 3.27,
CMake Warning (dev) at cmake/OpenCVUtils.cmake:144 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This patch sets policy 0148 explicitly to suppress the warning.
This commit is contained in:
Letu Ren 2024-05-14 22:22:05 +08:00
parent 3c7e94b275
commit 7fc8a490f8

View File

@ -85,6 +85,10 @@ if(POLICY CMP0146)
cmake_policy(SET CMP0146 OLD) # CMake 3.27+: use CMake FindCUDA if available.
endif()
if(POLICY CMP0148)
cmake_policy(SET CMP0148 OLD) # CMake 3.27+: use CMake FindPythonInterp and FindPythonLib if available.
endif()
#
# Configure OpenCV CMake hooks
#