telepathy-qt: CMake: Fix build with CMake < 3.12
Alexandr Akulich
kaffeine at kemper.freedesktop.org
Mon Oct 14 21:25:17 UTC 2019
Module: telepathy-qt
Branch: master
Commit: 336ff2a4b4f9a12bd0ff525f836ed37e564121a7
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=336ff2a4b4f9a12bd0ff525f836ed37e564121a7
Author: Alexander Akulich <akulichalexander at gmail.com>
Date: Fri Sep 20 02:35:39 2019 +0300
CMake: Fix build with CMake < 3.12
FindPython3 is available only since CMake-3.12, but PythonInterp (that
available for ages) is deprecated since that 3.12 release.
---
CMakeLists.txt | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abf19ec3..20b89e6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,9 +136,22 @@ add_feature_info("Qt GLib support" QT_GLIB_SUPPORT
set(CMAKE_REQUIRED_FLAGS "")
# Find python version >= 3
-find_package(Python3 REQUIRED)
-
-set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+if(${CMAKE_VERSION} VERSION_LESS 3.12)
+ find_package(PythonInterp 3 REQUIRED)
+ set_package_properties(PythonInterp PROPERTIES
+ DESCRIPTION "Python Interpreter"
+ URL "http://www.python.org"
+ TYPE REQUIRED)
+
+ # PythonInterp exposes PYTHON_EXECUTABLE on its own
+else()
+ find_package(Python3 REQUIRED)
+ set_package_properties(Python3 PROPERTIES
+ DESCRIPTION "Python Interpreter"
+ URL "http://www.python.org"
+ TYPE REQUIRED)
+ set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
+endif()
# Check for dbus-python
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import dbus.mainloop.glib"
More information about the telepathy-commits
mailing list