From a2af51bd14d10e83904e4d584ddcb830e8a865c8 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 12 May 2020 19:24:23 -0400 Subject: [PATCH] Ensure usage of Python 2.7 for resource.dat building. Unfortunately, this crap is super fragile. The dependencies of PyGTK, PyCairo, and rsvg are very pip unfriendly and do not work on Windows or Debian in a reliable manner at all. Better to just leave this for @Deledrius. --- Sources/Plasma/Apps/plClient/CMakeLists.txt | 6 +++--- cmake/FindPythonModule.cmake | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index 4ddd933197..024da1f1df 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -18,15 +18,15 @@ if(MOVIE_AVAILABLE) endif() # Test for Python Interpreter, which will be used for extra build scripts if available -find_package(PythonInterp) -set_package_properties(PythonInterp PROPERTIES +find_package(Python2) +set_package_properties(Python2 PROPERTIES URL "http://www.python.org" DESCRIPTION "Python Scripting language interpreter" TYPE OPTIONAL PURPOSE "Used to (re-)build some client resource files" ) -if(PYTHONINTERP_FOUND) +if(Python2_Interpreter_FOUND) include(FindPythonModule) # Test for Python modules needed to build resource.dat find_python_module(rsvg) diff --git a/cmake/FindPythonModule.cmake b/cmake/FindPythonModule.cmake index d17cefb1fb..e74520979d 100644 --- a/cmake/FindPythonModule.cmake +++ b/cmake/FindPythonModule.cmake @@ -3,7 +3,7 @@ # From http://ompl.hg.sourceforge.net/hgweb/ompl/ompl/file/tip/CMakeModules/FindPython.cmake -if(DEFINED PYTHON_EXECUTABLE) +if(Python2_Interpreter_FOUND) function(find_python_module module) string(TOUPPER ${module} module_upper) @@ -13,7 +13,7 @@ function(find_python_module module) endif() # A module's location is usually a directory, but for binary modules # it's a .so file. - execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" + execute_process(COMMAND "${Python2_EXECUTABLE}" "-c" "import re, ${module}; print re.compile('/__init__.py.*').sub('',${module}.__file__)" RESULT_VARIABLE _${module}_status OUTPUT_VARIABLE _${module}_location @@ -26,4 +26,4 @@ function(find_python_module module) find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper}) endfunction(find_python_module) -endif(DEFINED PYTHON_EXECUTABLE) +endif()