Skip to content

Commit 81c5f25

Browse files
sebasticm-kuhn
authored andcommittedMar 16, 2016
Don't require Python 3 for Qt5.
Use separate ENABLE_PYTHON3 option for Python 3.
1 parent f8175d3 commit 81c5f25

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed
 

‎CMakeLists.txt‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,12 @@ ENDIF (UNIX AND NOT APPLE)
678678
#############################################################
679679
# Python build dependency
680680

681-
IF(ENABLE_QT5)
681+
SET (ENABLE_PYTHON3 ${ENABLE_QT5} CACHE BOOL "If enabled will try to find Python 3 before looking for Python 2")
682+
IF(ENABLE_PYTHON3)
682683
SET(PYTHON_VER 3 CACHE STRING "Python version")
683-
ELSE(ENABLE_QT5)
684+
ELSE(ENABLE_PYTHON3)
684685
SET(PYTHON_VER 2.7 CACHE STRING "Python version")
685-
ENDIF(ENABLE_QT5)
686+
ENDIF(ENABLE_PYTHON3)
686687

687688
FIND_PACKAGE(PythonInterp ${PYTHON_VER} REQUIRED)
688689

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

722723
IF (WITH_CUSTOM_WIDGETS)
723-
SET(PYUIC_WIDGET_PLUGIN_DIRECTORY ${PYQT4_MOD_DIR}/uic/widget-plugins/)
724+
IF(ENABLE_QT5)
725+
SET(PYUIC_WIDGET_PLUGIN_DIRECTORY ${PYQT5_MOD_DIR}/uic/widget-plugins/)
726+
ELSE(ENABLE_QT5)
727+
SET(PYUIC_WIDGET_PLUGIN_DIRECTORY ${PYQT4_MOD_DIR}/uic/widget-plugins/)
728+
ENDIF(ENABLE_QT5)
724729
ENDIF (WITH_CUSTOM_WIDGETS)
725730

726731
ENDIF (WITH_BINDINGS)

‎ci/travis/linux/qt5/install.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ cmake \
3636
-DWITH_ASTYLE=ON \
3737
-DWITH_SERVER=ON \
3838
-DENABLE_QT5=ON \
39+
-DENABLE_PYTHON3=ON \
3940
-DCXX_EXTRA_FLAGS="$CLANG_WARNINGS" \
4041
-DPYTHON_LIBRARY=/usr/lib/libpython3.2mu.so \
4142
..

‎cmake/FindPyQt5.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
'pyqt_version': PyQt5.QtCore.PYQT_VERSION,
4848
'pyqt_version_str': PyQt5.QtCore.PYQT_VERSION_STR,
4949
'pyqt_sip_flags': PyQt5.QtCore.PYQT_CONFIGURATION['sip_flags'],
50-
'pyqt_mod_dir': cfg.default_mod_dir,
50+
'pyqt_mod_dir': os.path.join(cfg.default_mod_dir, "PyQt5"),
5151
'pyqt_sip_dir': sip_dir,
5252
'pyqt_bin_dir': cfg.default_bin_dir,
5353
}

‎cmake/FindPythonLibrary.cmake‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ else(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "
4444
endif("${PYTHON_CUSTOM_FRAMEWORK}" MATCHES "Python\\.framework")
4545
endif(APPLE AND PYTHON_CUSTOM_FRAMEWORK)
4646

47-
IF (ENABLE_QT5)
47+
IF (ENABLE_PYTHON3)
4848
FIND_PACKAGE(PythonInterp 3)
49-
ELSE (ENABLE_QT5)
49+
ELSE (ENABLE_PYTHON3)
5050
FIND_PACKAGE(PythonInterp 2.7)
51-
ENDIF (ENABLE_QT5)
51+
ENDIF (ENABLE_PYTHON3)
5252

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

0 commit comments

Comments
 (0)
Please sign in to comment.