How can i update cmake code with Findpython3 avoid cmpo148 Warning??

as the title said. when i build opencv from resources codes in ubuntu24 encounter cmp0148 warnning. But i don not like to use the cmake_policy command to set the policy and suppress this warning. I want new codes such as Findpython3 instead the old FindPythonInterp and FindPythonLibs modules. So is there any help for me to modify the cmake codes? thank you very much!! the warnning message like this "

– Detected processor: x86_64
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.

Call Stack (most recent call first):
cmake/OpenCVDetectPython.cmake:64 (find_host_package)
cmake/OpenCVDetectPython.cmake:265 (find_python)
CMakeLists.txt:666 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

– Found PythonInterp: /usr/bin/python3 (found suitable version “3.12.3”, minimum required is “3.2”)
CMake Warning (dev) at cmake/OpenCVDetectPython.cmake:136 (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.

Call Stack (most recent call first):
cmake/OpenCVDetectPython.cmake:265 (find_python)
CMakeLists.txt:666 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

– Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.12.so (found suitable exact version “3.12.3”)

"