From 4fe5bceb353f5dfcef4f78f9266c0983521bd7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Thu, 25 Apr 2024 14:25:54 +0200 Subject: [PATCH] Only suppress Python warnings on new enough CMake (#139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Older CMake doesn't have the policy, so skip it there. Signed-off-by: Alejandro Hernández Cordero --- cmake/shiboken_helper.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/shiboken_helper.cmake b/cmake/shiboken_helper.cmake index 0575d63..7624157 100644 --- a/cmake/shiboken_helper.cmake +++ b/cmake/shiboken_helper.cmake @@ -24,7 +24,9 @@ set(__PYTHON_QT_BINDING_SHIBOKEN_HELPER_INCLUDED TRUE) # In CMake 3.27 and later, FindPythonInterp and FindPythonLibs are deprecated. # However, Shiboken2 as packaged in Ubuntu 24.04 still use them, so set CMP0148 to # "OLD" to silence this warning. -cmake_policy(SET CMP0148 OLD) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27.0") + cmake_policy(SET CMP0148 OLD) +endif() find_package(Shiboken2 QUIET) if(Shiboken2_FOUND) message(STATUS "Found Shiboken2 version ${Shiboken2_VERSION}")