Skip to content
Permalink
Browse files

Don't require Python 3 for Qt5.

Use separate ENABLE_PYTHON3 option for Python 3.
  • Loading branch information
sebastic authored and m-kuhn committed Mar 16, 2016
1 parent f8175d3 commit 81c5f25a7f627eb818de1c3d9e4b9e4227b695f1
Showing with 14 additions and 8 deletions.
  1. +9 −4 CMakeLists.txt
  2. +1 −0 ci/travis/linux/qt5/install.sh
  3. +1 −1 cmake/FindPyQt5.py
  4. +3 −3 cmake/FindPythonLibrary.cmake
@@ -678,11 +678,12 @@ ENDIF (UNIX AND NOT APPLE)
#############################################################
# Python build dependency

IF(ENABLE_QT5)
SET (ENABLE_PYTHON3 ${ENABLE_QT5} CACHE BOOL "If enabled will try to find Python 3 before looking for Python 2")
IF(ENABLE_PYTHON3)
SET(PYTHON_VER 3 CACHE STRING "Python version")
ELSE(ENABLE_QT5)
ELSE(ENABLE_PYTHON3)
SET(PYTHON_VER 2.7 CACHE STRING "Python version")
ENDIF(ENABLE_QT5)
ENDIF(ENABLE_PYTHON3)

FIND_PACKAGE(PythonInterp ${PYTHON_VER} REQUIRED)

@@ -720,7 +721,11 @@ IF (WITH_BINDINGS)
ENDIF (NOT BINDINGS_GLOBAL_INSTALL)

IF (WITH_CUSTOM_WIDGETS)
SET(PYUIC_WIDGET_PLUGIN_DIRECTORY ${PYQT4_MOD_DIR}/uic/widget-plugins/)
IF(ENABLE_QT5)
SET(PYUIC_WIDGET_PLUGIN_DIRECTORY ${PYQT5_MOD_DIR}/uic/widget-plugins/)
ELSE(ENABLE_QT5)
SET(PYUIC_WIDGET_PLUGIN_DIRECTORY ${PYQT4_MOD_DIR}/uic/widget-plugins/)
ENDIF(ENABLE_QT5)
ENDIF (WITH_CUSTOM_WIDGETS)

ENDIF (WITH_BINDINGS)
@@ -36,6 +36,7 @@ cmake \
-DWITH_ASTYLE=ON \
-DWITH_SERVER=ON \
-DENABLE_QT5=ON \
-DENABLE_PYTHON3=ON \
-DCXX_EXTRA_FLAGS="$CLANG_WARNINGS" \
-DPYTHON_LIBRARY=/usr/lib/libpython3.2mu.so \
..
@@ -47,7 +47,7 @@
'pyqt_version': PyQt5.QtCore.PYQT_VERSION,
'pyqt_version_str': PyQt5.QtCore.PYQT_VERSION_STR,
'pyqt_sip_flags': PyQt5.QtCore.PYQT_CONFIGURATION['sip_flags'],
'pyqt_mod_dir': cfg.default_mod_dir,
'pyqt_mod_dir': os.path.join(cfg.default_mod_dir, "PyQt5"),
'pyqt_sip_dir': sip_dir,
'pyqt_bin_dir': cfg.default_bin_dir,
}
@@ -44,11 +44,11 @@ else(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "
endif("${PYTHON_CUSTOM_FRAMEWORK}" MATCHES "Python\\.framework")
endif(APPLE AND PYTHON_CUSTOM_FRAMEWORK)

IF (ENABLE_QT5)
IF (ENABLE_PYTHON3)
FIND_PACKAGE(PythonInterp 3)
ELSE (ENABLE_QT5)
ELSE (ENABLE_PYTHON3)
FIND_PACKAGE(PythonInterp 2.7)
ENDIF (ENABLE_QT5)
ENDIF (ENABLE_PYTHON3)

if(PYTHONINTERP_FOUND)
FIND_FILE(_find_lib_python_py FindLibPython.py PATHS ${CMAKE_MODULE_PATH})

0 comments on commit 81c5f25

Please sign in to comment.
You can’t perform that action at this time.