Skip to content

Commit

Permalink
Ensure usage of Python 2.7 for resource.dat building.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Hoikas committed May 15, 2020
1 parent 0a47cc8 commit a98ab16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Sources/Plasma/Apps/plClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions cmake/FindPythonModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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()

0 comments on commit a98ab16

Please sign in to comment.