0002-CMakeLists.txt-fix-build-with-python-and-cmake-3.7.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 4b77662232c806b8aba7680405144ad51ac3671b Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Thu, 29 Nov 2018 00:36:00 +0100
  4. Subject: [PATCH] CMakeLists.txt: fix build with python and cmake <= 3.7
  5. domoticz will fail to build with python and older cmake
  6. Indeed, find_package(PythonLibs 3.4) will not recognize python 3.7 until
  7. cmake 3.7 and the following commit:
  8. https://github.com/Kitware/CMake/commit/c31573b9641e0f1bc7a34149506db51f3494323b
  9. To fix this, add a call to find_package(PythonInterp 3.4). Indeed, if
  10. FindPythonInterp has already found the major and minor version, that
  11. version will be inserted between the user supplied versions and the
  12. stock version list since cmake in version 3.1 and
  13. https://github.com/Kitware/CMake/commit/3816cd2dc7a7cc220e4f1b1e87fee986545b9cb3
  14. Fixes:
  15. - http://autobuild.buildroot.org/results/8e82501a7b49da628ec026132ffca44c0c813040
  16. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  17. [Upstream status: https://github.com/domoticz/domoticz/pull/2889]
  18. ---
  19. CMakeLists.txt | 1 +
  20. 1 file changed, 1 insertion(+)
  21. diff --git a/CMakeLists.txt b/CMakeLists.txt
  22. index f4e38b88..41003a0c 100644
  23. --- a/CMakeLists.txt
  24. +++ b/CMakeLists.txt
  25. @@ -125,6 +125,7 @@ ENDIF(USE_BUILTIN_SQLITE)
  26. option(USE_PYTHON "Use Python for Plugins and Event-Scripts" YES)
  27. IF(USE_PYTHON)
  28. + find_package(PythonInterp 3.4)
  29. find_package(PythonLibs 3.4)
  30. IF(PYTHONLIBS_FOUND)
  31. MESSAGE(STATUS "Python3 includes found at: ${PYTHON_INCLUDE_PATH}")
  32. --
  33. 2.14.1