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.
pull/25585/head
Letu Ren 6 months ago
parent 3c7e94b275
commit 7fc8a490f8
  1. 4
      CMakeLists.txt

@ -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
#

Loading…
Cancel
Save