From 7fc8a490f8554939cd44e644075c45facde13757 Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Tue, 14 May 2024 22:22:05 +0800 Subject: [PATCH] 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. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9753cf05aaeb..8d79f2a2ba29 100644 --- a/CMakeLists.txt +++ b/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 #