From a39b579d2b5d097134f61fbb316d9ab0dc45a5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sat, 27 Apr 2019 11:46:45 +0200 Subject: [PATCH] Only require Shiboken2 and PySide2 Version up to Minor (#1491) --- src/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa1a6be1..da3e52c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -73,8 +73,14 @@ if(CUTTER_ENABLE_PYTHON) if(CUTTER_ENABLE_PYTHON_BINDINGS) find_package(PythonInterp REQUIRED) - find_package(Shiboken2 "${Qt5_VERSION}" REQUIRED) - find_package(PySide2 "${Qt5_VERSION}" REQUIRED) + # 5.12.3 => 5.12 + if("${Qt5_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+") + set(Shiboken2_VERSION_REQUIRED "${CMAKE_MATCH_1}") + else() + message(FATAL_ERROR "Failed to recognize Qt version") + endif() + find_package(Shiboken2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED) + find_package(PySide2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED) get_target_property(PYSIDE_INCLUDE_DIR PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES) list(GET PYSIDE_INCLUDE_DIR 0 PYSIDE_INCLUDE_DIR)