Skip to content

Commit

Permalink
Only suppress Python warnings on new enough CMake (#139)
Browse files Browse the repository at this point in the history
* Older CMake doesn't have the policy, so skip it there.

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
  • Loading branch information
ahcorde authored Apr 25, 2024
1 parent e6b881e commit 4fe5bce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/shiboken_helper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 4fe5bce

Please sign in to comment.