Skip to content

Commit

Permalink
Merge pull request #3510 from nyalldawson/qt5_tests
Browse files Browse the repository at this point in the history
Require python 3 and qt5
  • Loading branch information
nyalldawson authored Sep 20, 2016
2 parents 03923eb + ee57c1f commit cbff8f4
Show file tree
Hide file tree
Showing 167 changed files with 1,956 additions and 2,470 deletions.
64 changes: 4 additions & 60 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,6 @@
matrix:
fast_finish: true
allow_failures:
- os: osx
include:
# QT4 based build with Python 2.7 // using container based builds and prebuild binary dependencies in osgeo4travis
- os: linux
language: cpp
env:
- BUILD=qt4
- QT_VERSION=4
# - LLVM_VERSION=3.8
sudo: false
cache:
apt: true
directories:
- $HOME/.ccache
compiler: gcc
addons:
postgresql: "9.4"
apt:
sources:
# - llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
- george-edison55-precise-backports # doxygen 1.8.3
packages:
- bison
- gcc-6
- g++-6
- doxygen
- flex
- flip
- libfcgi-dev
- libfftw3-3
- libpq-dev
- libqscintilla2-dev
- libqt4-dev
- libqt4-opengl-dev
- libqt4-sql-sqlite
- libqtwebkit-dev
- libqwt-dev
- libspatialindex-dev
- libspatialite-dev
- libsqlite3-dev
- pkg-config
- poppler-utils
- pyqt4-dev-tools
- python
- python-dev
- python-numpy
- python-pip
- python-psycopg2
- python-qscintilla2
- python-qt4-dev
- python-qt4-sql
- python-sip
- python-sip-dev
- txt2tags
- xvfb
# QT5 based build with Python 3 // using container based builds and prebuild binary dependencies in osgeo4travis
- os: linux
language: python # This lets us use newer python versions from virtualenv
Expand Down Expand Up @@ -93,10 +37,10 @@ matrix:
- flip
- clang-3.8
# OSX based build with QT4 and Python 2
- os: osx
env:
- BUILD=osx
- IGNORE_BUILD_FAILURES=YES
# - os: osx
# env:
# - BUILD=osx
# - IGNORE_BUILD_FAILURES=YES

git:
depth: 30
Expand Down
98 changes: 28 additions & 70 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,47 +246,27 @@ ELSE (WITH_QTWEBKIT)
MESSAGE(STATUS "Qt WebKit support DISABLED.")
ENDIF(WITH_QTWEBKIT)
#############################################################
# search for Qt4
SET(QT_MIN_VERSION 4.8.0)
SET (ENABLE_QT5 FALSE CACHE BOOL "If enabled will try to find Qt5 before looking for Qt4")
IF (ENABLE_QT5)
FIND_PACKAGE(Qt5Core QUIET)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Qt5Network REQUIRED)
FIND_PACKAGE(Qt5Xml REQUIRED)
FIND_PACKAGE(Qt5Svg REQUIRED)
FIND_PACKAGE(Qt5Concurrent REQUIRED)
FIND_PACKAGE(Qt5PrintSupport REQUIRED)
FIND_PACKAGE(Qt5Positioning)
IF (WITH_QTWEBKIT)
FIND_PACKAGE(Qt5WebKit REQUIRED)
FIND_PACKAGE(Qt5WebKitWidgets REQUIRED)
ENDIF(WITH_QTWEBKIT)
FIND_PACKAGE(Qt5Test REQUIRED)
FIND_PACKAGE(Qt5UiTools REQUIRED)
FIND_PACKAGE(Qt5Script REQUIRED)
FIND_PACKAGE(Qt5Sql REQUIRED)
SET(QT5_BUILD TRUE)
INCLUDE("cmake/modules/ECMQt4To5Porting.cmake")
MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
IF (WITH_QTWEBKIT)
SET(QT_USE_QTWEBKIT 1)
ENDIF(WITH_QTWEBKIT)
IF (NOT QT_QTXML_FOUND OR NOT QT_QTNETWORK_FOUND OR NOT QT_QTSVG_FOUND OR NOT QT_QTSQL_FOUND OR (WITH_QTWEBKIT AND NOT QT_QTWEBKIT_FOUND) OR (WITH_CUSTOM_WIDGETS AND NOT QT_QTDESIGNER_FOUND))
MESSAGE(SEND_ERROR "Some Qt4 modules haven't been found!")
ENDIF (NOT QT_QTXML_FOUND OR NOT QT_QTNETWORK_FOUND OR NOT QT_QTSVG_FOUND OR NOT QT_QTSQL_FOUND OR (WITH_QTWEBKIT AND NOT QT_QTWEBKIT_FOUND) OR (WITH_CUSTOM_WIDGETS AND NOT QT_QTDESIGNER_FOUND))

INCLUDE( ${QT_USE_FILE} )

MESSAGE(STATUS "Found Qt version: ${QTVERSION}")
ENDIF()
# search for Qt5
SET(QT_MIN_VERSION 5.2.0)
FIND_PACKAGE(Qt5Core QUIET)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Qt5Network REQUIRED)
FIND_PACKAGE(Qt5Xml REQUIRED)
FIND_PACKAGE(Qt5Svg REQUIRED)
FIND_PACKAGE(Qt5Concurrent REQUIRED)
FIND_PACKAGE(Qt5PrintSupport REQUIRED)
FIND_PACKAGE(Qt5Positioning)
IF (WITH_QTWEBKIT)
FIND_PACKAGE(Qt5WebKit REQUIRED)
FIND_PACKAGE(Qt5WebKitWidgets REQUIRED)
ENDIF(WITH_QTWEBKIT)
FIND_PACKAGE(Qt5Test REQUIRED)
FIND_PACKAGE(Qt5UiTools REQUIRED)
FIND_PACKAGE(Qt5Script REQUIRED)
FIND_PACKAGE(Qt5Sql REQUIRED)
INCLUDE("cmake/modules/ECMQt4To5Porting.cmake")
MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}")

IF (WITH_QTMOBILITY)
FIND_PACKAGE(QtMobility 1.1.0)
Expand All @@ -312,12 +292,6 @@ ENDIF (WITH_TOUCH)
# search for QScintilla2 (C++ lib)
FIND_PACKAGE(QScintilla REQUIRED)

# search for QJSON and decide whether to enable ArcGIS providers
FIND_PACKAGE (QJSON)
IF (QJSON_FOUND AND NOT ENABLE_QT5)
SET (WITH_ARCGIS TRUE)
ENDIF (QJSON_FOUND AND NOT ENABLE_QT5)

# Master password hash and authentication encryption
FIND_PACKAGE(QCA REQUIRED)
# Check for runtime dependency of qca-ossl plugin
Expand Down Expand Up @@ -690,7 +664,7 @@ IF (UNIX AND NOT APPLE)
SET (QGIS_MANUAL_DIR ${CMAKE_INSTALL_PREFIX}/${QGIS_MANUAL_SUBDIR})
ENDIF (UNIX AND NOT APPLE)

SET (DISABLE_DEPRECATED ${ENABLE_QT5} CACHE BOOL "If set to true, it will disable deprecated functionality to prepare for the next generation of QGIS")
SET (DISABLE_DEPRECATED FALSE CACHE BOOL "If set to true, it will disable deprecated functionality to prepare for the next generation of QGIS")
IF (DISABLE_DEPRECATED)
ADD_DEFINITIONS(-DQGIS_DISABLE_DEPRECATED)
ENDIF (DISABLE_DEPRECATED)
Expand All @@ -699,12 +673,7 @@ ENDIF (DISABLE_DEPRECATED)
#############################################################
# Python build dependency

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_PYTHON3)
SET(PYTHON_VER 2.7 CACHE STRING "Python version")
ENDIF(ENABLE_PYTHON3)
SET(PYTHON_VER 3 CACHE STRING "Python version")

FIND_PACKAGE(PythonInterp ${PYTHON_VER} REQUIRED)

Expand All @@ -715,17 +684,10 @@ IF (WITH_BINDINGS)

FIND_PACKAGE(PythonLibrary REQUIRED)

# python support: check for interpreter, sip, pyqt4
IF(ENABLE_QT5)
FIND_PACKAGE(PyQt5 REQUIRED)
SET(PYQT_SIP_FLAGS ${PYQT5_SIP_FLAGS})
SET(PYQT_SIP_DIR ${PYQT5_SIP_DIR})
ELSE(ENABLE_QT5)
FIND_PACKAGE(PyQt4 REQUIRED)
# setup SIP variables
SET(PYQT_SIP_FLAGS ${PYQT4_SIP_FLAGS})
SET(PYQT_SIP_DIR ${PYQT4_SIP_DIR})
ENDIF(ENABLE_QT5)
# python support: check for interpreter, sip, pyqt5
FIND_PACKAGE(PyQt5 REQUIRED)
SET(PYQT_SIP_FLAGS ${PYQT5_SIP_FLAGS})
SET(PYQT_SIP_DIR ${PYQT5_SIP_DIR})
SEPARATE_ARGUMENTS(PYQT_SIP_FLAGS) # convert space separated values to a list

FIND_PACKAGE(SIP REQUIRED)
Expand All @@ -742,11 +704,7 @@ IF (WITH_BINDINGS)
ENDIF (NOT BINDINGS_GLOBAL_INSTALL)

IF (WITH_CUSTOM_WIDGETS)
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)
SET(PYUIC_WIDGET_PLUGIN_DIRECTORY ${PYQT5_MOD_DIR}/uic/widget-plugins/)
ENDIF (WITH_CUSTOM_WIDGETS)

ENDIF (WITH_BINDINGS)
Expand Down
2 changes: 0 additions & 2 deletions ci/travis/linux/qt5/blacklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ PyQgsJSONUtils
PyQgsLocalServer
PyQgsPalLabelingServer
PyQgsServer
PyQgsServerAccessControl
PyQgsSipCoverage
qgis_composermapgridtest
qgis_composerutils
ProcessingGrass7AlgorithmsImageryTest
Expand Down
2 changes: 0 additions & 2 deletions ci/travis/linux/qt5/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ cmake \
-DWITH_ASTYLE=ON \
-DWITH_SERVER=ON \
-DWITH_INTERNAL_YAML=OFF \
-DENABLE_QT5=ON \
-DENABLE_PYTHON3=ON \
-DDISABLE_DEPRECATED=ON \
-DPORT_PLUGINS=ON \
-DCXX_EXTRA_FLAGS="$CLANG_WARNINGS" \
Expand Down
6 changes: 1 addition & 5 deletions cmake/FindPythonLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ 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_PYTHON3)
FIND_PACKAGE(PythonInterp 3)
ELSE (ENABLE_PYTHON3)
FIND_PACKAGE(PythonInterp 2.7)
ENDIF (ENABLE_PYTHON3)
FIND_PACKAGE(PythonInterp 3)

if(PYTHONINTERP_FOUND)
FIND_FILE(_find_lib_python_py FindLibPython.py PATHS ${CMAKE_MODULE_PATH})
Expand Down
6 changes: 1 addition & 5 deletions cmake/FindQCA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ if(QCA_INCLUDE_DIR AND QCA_LIBRARY)

else(QCA_INCLUDE_DIR AND QCA_LIBRARY)

if(ENABLE_QT5)
set(QCA_LIBRARY_NAMES qca-qt5 qca2-qt5)
else(ENABLE_QT5)
set(QCA_LIBRARY_NAMES qca qca2)
endif(ENABLE_QT5)
set(QCA_LIBRARY_NAMES qca-qt5 qca2-qt5)

find_library(QCA_LIBRARY
NAMES ${QCA_LIBRARY_NAMES}
Expand Down
6 changes: 1 addition & 5 deletions cmake/FindQScintilla.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ ELSE(EXISTS QSCINTILLA_VERSION_STR)
/usr/include
)

if(ENABLE_QT5)
set(QSCINTILLA_LIBRARY_NAMES qscintilla2-qt5 libqt5scintilla2 libqscintilla2-qt5 qt5scintilla2 libqscintilla2-qt5.dylib)
else(ENABLE_QT5)
set(QSCINTILLA_LIBRARY_NAMES qscintilla2 libqscintilla2 libqscintilla2.dylib)
endif(ENABLE_QT5)
set(QSCINTILLA_LIBRARY_NAMES qscintilla2-qt5 libqt5scintilla2 libqscintilla2-qt5 qt5scintilla2 libqscintilla2-qt5.dylib)

find_library(QSCINTILLA_LIBRARY
NAMES ${QSCINTILLA_LIBRARY_NAMES}
Expand Down
21 changes: 5 additions & 16 deletions cmake/FindQsci.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ ELSE(EXISTS QSCI_MOD_VERSION_STR)

FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH})

IF(ENABLE_QT5)
SET(QSCI_VER 5)
ELSE(ENABLE_QT5)
SET(QSCI_VER 4)
ENDIF(ENABLE_QT5)
SET(QSCI_VER 5)

EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver)

Expand All @@ -37,17 +33,10 @@ ELSE(EXISTS QSCI_MOD_VERSION_STR)
ENDIF(qsci_ver)

IF(QSCI_FOUND)
IF(ENABLE_QT5)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod5.sip
PATHS ${PYQT5_SIP_DIR}
)
ELSE(ENABLE_QT5)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod4.sip
PATHS ${PYQT4_SIP_DIR}
)
ENDIF(ENABLE_QT5)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod5.sip
PATHS ${PYQT5_SIP_DIR}
)

IF(NOT QSCI_FIND_QUIETLY)
MESSAGE(STATUS "Found QScintilla2 PyQt module: ${QSCI_MOD_VERSION_STR}")
Expand Down
6 changes: 1 addition & 5 deletions cmake/FindQwt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ FIND_PATH(QWT_INCLUDE_DIR NAMES qwt.h PATHS
PATH_SUFFIXES qwt-qt4 qwt qwt5 qwt6
)

if(ENABLE_QT5)