diff options
| author | Thomas Huth <huth@tuxfamily.org> | 2022-07-31 18:50:59 (GMT) |
|---|---|---|
| committer | Thomas Huth <huth@tuxfamily.org> | 2022-08-01 17:56:46 (GMT) |
| commit | 7464d78448514241ead1645d757e6cadb4edd5da (patch) | |
| tree | f548bfc848a0de8eaa41a61fda13347a6f5908d2 | |
| parent | a9c98fdfdfdf4885eb423f10b9d6934db5837867 (diff) | |
| download | hatari-7464d784485142.zip hatari-7464d784485142.tar.gz | |
Check for the availability of Python Gtk before using the python-ui
| -rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3867c6a..c4b2128 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,7 +325,18 @@ if(PYTHONINTERP_FOUND AND PYTHON_VERSION_MAJOR LESS 3) unset(PYTHONINTERP_FOUND) endif() if(PYTHONINTERP_FOUND) - add_subdirectory(python-ui) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "\ +import gi\n\ +gi.require_version('Gtk', '3.0')\n\ +from gi.repository import Gtk\n\ +from gi.repository import Gdk\n\ +from gi.repository import GdkPixbuf\n\ +from gi.repository import GLib" + RESULT_VARIABLE PYTHON_GTK_RESULT + OUTPUT_QUIET ERROR_QUIET) + if(${PYTHON_GTK_RESULT} EQUAL 0) + add_subdirectory(python-ui) + endif() endif(PYTHONINTERP_FOUND) if(UNIX AND NOT ENABLE_OSX_BUNDLE) @@ -377,6 +388,12 @@ else() message( " - capsimage :\tv5 not found, install it to use .IPF, .RAW and .CTR disk images" ) endif(CapsImage_FOUND) +if(${PYTHON_GTK_RESULT} EQUAL 0) + message( " - python Gtk:\tfound, python-ui can be used" ) +else() + message( " - python Gtk:\tnot found, install it to enable the python-ui" ) +endif() + if(Udev_FOUND) message( " - udev :\tfound, required for media change detection in NatFeats SCSI" ) message( " \tdevices on udev-based systems (Linux)" ) |
