Skip to content
Permalink
Browse files

Remove a bunch of Qt4 compatibility code

  • Loading branch information
nyalldawson committed Feb 6, 2018
1 parent fc16972 commit 3e1b99be69c5411ccc6cab39194a759089397f10
@@ -304,7 +304,7 @@ IF(WITH_CORE)
MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}")

IF(WITH_QTWEBKIT)
SET(OPTIONAL_QTWEBKIT ${QT_QTWEBKIT_LIBRARY})
SET(OPTIONAL_QTWEBKIT ${Qt5WebKitWidgets_LIBRARIES})
ENDIF(WITH_QTWEBKIT)

IF (WITH_QTMOBILITY)
@@ -13,7 +13,7 @@
function(FIND_QCAOSSL_PLUGIN_CPP PLUGIN_REQUIRED)

# requires Qt and QCA packages to be found
if(QT_INCLUDE_DIR AND QT_QTCORE_INCLUDE_DIR AND QT_QTCORE_LIBRARY
if(QT_INCLUDE_DIR AND QT_QTCORE_INCLUDE_DIR AND Qt5Core_LIBRARIES
AND QCA_INCLUDE_DIR AND QCA_LIBRARY
AND NOT CMAKE_CROSSCOMPILING)

@@ -38,7 +38,7 @@ function(FIND_QCAOSSL_PLUGIN_CPP PLUGIN_REQUIRED)
set(TESTCPP "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/qcaossl.cpp")
file(WRITE ${TESTCPP} "${CODE}")

set(QCA_INCLUDE_DIRECTORIES "-DINCLUDE_DIRECTORIES:STRING=${QT_INCLUDES};${QCA_INCLUDE_DIR}")
set(QCA_INCLUDE_DIRECTORIES "-DINCLUDE_DIRECTORIES:STRING=${Qt5Core_INCLUDE_DIRS};${QCA_INCLUDE_DIR}")
get_target_property(_QtCore_path Qt5::Core LOCATION)
set(QCA_LINK_LIBRARIES "-DLINK_LIBRARIES:STRING=${_QtCore_path};${QCA_LIBRARY}")

@@ -37,56 +37,6 @@ include(MacroAddFileDependencies)

# Portability helpers.

set(QT_QTGUI_LIBRARIES
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5PrintSupport_LIBRARIES}
${Qt5Svg_LIBRARIES}
)

set(QT_INCLUDES
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS}
${Qt5Svg_INCLUDE_DIRS}
)
set(QT_QTGUI_LIBRARY ${QT_QTGUI_LIBRARIES})

set(_qt_modules
Core
Declarative
Widgets
Script
ScriptTools
Network
Test
Designer
Concurrent
Xml
XmlPatterns
UiTools
Qml
Quick1
WebKit
WebKitWidgets
Sql
OpenGL
)

foreach(_module ${_qt_modules})
string(TOUPPER ${_module} _module_upper)
set(QT_QT${_module_upper}_LIBRARIES ${Qt5${_module}_LIBRARIES})
set(QT_QT${_module_upper}_LIBRARY ${QT_QT${_module_upper}_LIBRARIES})
list(APPEND QT_INCLUDES ${Qt5${_module}_INCLUDE_DIRS})
set(QT_QT${_module_upper}_FOUND ${Qt5${_module}_FOUND})
endforeach()

list(APPEND QT_QTCORE_LIBRARY ${Qt5Concurrent_LIBRARIES})

list(APPEND QT_QTWEBKIT_LIBRARY ${Qt5WebKitWidgets_LIBRARIES})

Find_Program(QT_LRELEASE_EXECUTABLE NAMES lrelease-qt5 lrelease)

add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)

# get the Qt plugins directory
@@ -13,8 +13,8 @@ QT5_WRAP_CPP(QSQLSPATIALITE_SRC qsql_spatialite.h smain.h)

ADD_LIBRARY(qsqlspatialite SHARED ${QSQLSPATIALITE_SRC})
TARGET_LINK_LIBRARIES(qsqlspatialite
${QT_QTCORE_LIBRARY}
${QT_QTSQL_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Sql_LIBRARIES}
${SQLITE3_LIBRARY}
${SPATIALITE_LIBRARY}
qgis_core
@@ -1,4 +1,4 @@

Find_Program(QT_LRELEASE_EXECUTABLE NAMES lrelease-qt5 lrelease)

MACRO(ADD_TRANSLATION_FILES _sources )

@@ -707,8 +707,8 @@ ADD_LIBRARY(qgis_app SHARED ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${QGIS_APP_HDR

TARGET_LINK_LIBRARIES(qgis_app
${QWT_LIBRARY}
${QT_QTSQL_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
${Qt5Sql_LIBRARIES}
${Qt5UiTools_LIBRARIES}
${OPTIONAL_QTWEBKIT}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
@@ -1270,13 +1270,16 @@ IF (QT_MOBILITY_LOCATION_FOUND)
ENDIF (QT_MOBILITY_LOCATION_FOUND)

TARGET_LINK_LIBRARIES(qgis_core
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTSVG_LIBRARY}
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5PrintSupport_LIBRARIES}
${Qt5Network_LIBRARIES}
${OPTIONAL_QTWEBKIT}
${QT_QTSQL_LIBRARY}
${Qt5Sql_LIBRARIES}
${Qt5Concurrent_LIBRARIES}
${QCA_LIBRARY}
${QTKEYCHAIN_LIBRARY}
${PROJ_LIBRARY}
@@ -23,8 +23,9 @@ ADD_EXECUTABLE(qgiscrashhandler WIN32
)

TARGET_LINK_LIBRARIES(qgiscrashhandler
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
DbgHelp
)

@@ -968,7 +968,7 @@ ADD_DEPENDENCIES(qgis_gui ui)
TARGET_LINK_LIBRARIES(qgis_gui
qgis_core
qgis_native
${QT_QTUITOOLS_LIBRARY}
${Qt5UiTools_LIBRARIES}
${QWT_LIBRARY}
${QSCINTILLA_LIBRARY}
)
@@ -74,7 +74,7 @@ INCLUDE_DIRECTORIES(
TARGET_LINK_LIBRARIES(evis
qgis_core
qgis_gui
${QT_QTSQL_LIBRARY}
${Qt5Sql_LIBRARIES}
)


@@ -229,8 +229,9 @@ MACRO(ADD_GRASSPLUGIN GRASS_BUILD_VERSION)
)

TARGET_LINK_LIBRARIES (qgis.g.browser${GRASS_BUILD_VERSION}
${QT_QTGUI_LIBRARY}
${QT_QTCORE_LIBRARY}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Core_LIBRARIES}
)

########################################################
@@ -62,7 +62,7 @@ ADD_LIBRARY (db2provider MODULE ${DB2_SRCS} ${DB2_HDRS} ${DB2_MOC_SRCS})

TARGET_LINK_LIBRARIES (db2provider
qgis_core
${QT_QTSQL_LIBRARY}
${Qt5Sql_LIBRARIES}
)

IF (WITH_GUI)
@@ -64,7 +64,7 @@ ADD_LIBRARY(mssqlprovider MODULE ${MSSQL_SRCS} ${MSSQL_MOC_SRCS} ${MSSQL_HDRS})

TARGET_LINK_LIBRARIES(mssqlprovider
qgis_core
${QT_QTSQL_LIBRARY}
${Qt5Sql_LIBRARIES}
)

IF (WITH_GUI)
@@ -71,7 +71,7 @@ ADD_LIBRARY (oracleprovider MODULE ${ORACLE_SRCS} ${ORACLE_HDRS} ${ORACLE_MOC_SR

TARGET_LINK_LIBRARIES (oracleprovider
qgis_core
${QT_QTSQL_LIBRARY}
${Qt5Sql_LIBRARIES}
)

IF (WITH_GUI)
@@ -20,8 +20,8 @@ QT5_WRAP_CPP(QSQLOCISPATIAL_MOC_SRC qsql_ocispatial.h main.h)
ADD_LIBRARY(qsqlocispatial SHARED ${QSQLOCISPATIAL_SRC} ${QSQLOCISPATIAL_MOC_SRC})

TARGET_LINK_LIBRARIES(qsqlocispatial
${QT_QTCORE_LIBRARY}
${QT_QTSQL_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Sql_LIBRARIES}
${OCI_LIBRARY}
)

@@ -74,8 +74,9 @@ ADD_LIBRARY(virtuallayerprovider MODULE

TARGET_LINK_LIBRARIES( virtuallayerprovider
qgis_core
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${SQLITE3_LIBRARY}
${SPATIALITE_LIBRARY}
)
@@ -35,12 +35,12 @@ INCLUDE_DIRECTORIES(SYSTEM
TARGET_LINK_LIBRARIES(qgis_bench
qgis_core
${SQLITE3_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Xml_LIBRARIES}
${OPTIONAL_QTWEBKIT}
${QT_QTTEST_LIBRARY}
${Qt5Test_LIBRARIES}
)

IF(APPLE)
@@ -51,11 +51,11 @@ MACRO (ADD_QGIS_TEST testname testsrc)
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTORCC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTTEST_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Test_LIBRARIES}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
@@ -56,8 +56,8 @@ MACRO (ADD_QGIS_TEST TESTSRC)
ADD_EXECUTABLE(${TESTNAME} ${${TESTNAME}_SRCS})
SET_TARGET_PROPERTIES(${TESTNAME} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(${TESTNAME}
${QT_QTCORE_LIBRARY}
${QT_QTTEST_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Test_LIBRARIES}
qgis_analysis)
ADD_TEST(${TESTNAME} ${CMAKE_BINARY_DIR}/output/bin/${TESTNAME} -maxwarnings 10000)
#SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES
@@ -57,11 +57,11 @@ MACRO (ADD_QGIS_TEST testname testsrc)
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS})
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSQL_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTTEST_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Xml_LIBRARIES}
${Qt5Sql_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Test_LIBRARIES}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
@@ -51,10 +51,10 @@ MACRO (ADD_QGIS_TEST TESTSRC)
ADD_EXECUTABLE(${TESTNAME} ${TESTSRC} ${util_SRCS})
SET_TARGET_PROPERTIES(${TESTNAME} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(${TESTNAME}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTTEST_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Xml_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Test_LIBRARIES}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
@@ -41,10 +41,10 @@ MACRO (ADD_QGIS_TEST testname testsrc)
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS})
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTTEST_LIBRARY}
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Test_LIBRARIES}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
@@ -82,11 +82,11 @@ MACRO (ADD_QGIS_TEST testname testsrc)
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTORCC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTTEST_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Test_LIBRARIES}
${OPTIONAL_QTWEBKIT}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
@@ -63,8 +63,8 @@ MACRO (ADD_QGIS_TEST testname testsrc)
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS} ${IMAGE_RCC_SRCS})
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTCORE_LIBRARY}
${QT_QTTEST_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Test_LIBRARIES}
qgis_gui
qgis_native
)
@@ -41,10 +41,10 @@ MACRO (ADD_QGIS_TEST testname testsrc)
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS})
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTTEST_LIBRARY}
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Test_LIBRARIES}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
@@ -106,10 +106,10 @@ IF(UNIX AND NOT ANDROID AND CMAKE_BUILD_TYPE MATCHES Debug)
)

TARGET_LINK_LIBRARIES(qgis_wcstest
${QT_QTCORE_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${Qt5Core_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Xml_LIBRARIES}
${OPTIONAL_QTWEBKIT}
qgis_core
)
@@ -23,10 +23,10 @@ MACRO (ADD_QGIS_GRASS_TEST grass_build_version testname testsrc)
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX${grass_build_version}}\\\" \"-DGRASS_BUILD_VERSION=${grass_build_version}\""
)
TARGET_LINK_LIBRARIES(qgis_${testname}${grass_build_version}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTTEST_LIBRARY}
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Test_LIBRARIES}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}

0 comments on commit 3e1b99b

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