Stop using Qt5Transitional in Plasma Frameworks

Removes the find_package(Qt5Transitional) and does the proper
find_package(Qt5) with the list of modules.

Most of the porting is about using the Qt5:: targets.

REVIEW: 113345
This commit is contained in:
Aleix Pol 2013-10-22 00:40:17 +02:00
parent 92847333a0
commit af8a7bad7d
17 changed files with 46 additions and 69 deletions

View File

@ -1,26 +1,15 @@
cmake_minimum_required(VERSION 2.8.11)
project(plasma)
################# Disallow in-source build #################
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "plasma requires an out of source build. Please create a separate build directory and run 'cmake path_to_plasma [options]' there.")
endif()
project(Plasma)
# Make CPack available to easy generate binary packages
include(CPack)
include(FeatureSummary)
################# set KDE specific information #################
find_package(ECM 0.0.8 REQUIRED NO_MODULE)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
@ -47,17 +36,18 @@ endif()
set (QT_MIN_VERSION "5.2.0")
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Quick X11Extras Sql UiTools Qml Widgets Svg Declarative Script Test)
# Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs:
find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs
KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver
KConfig KAuth KJS KWallet KDBusAddons KI18n KGuiAddons KConfigWidgets
KService ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash
KService ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash KDeclarative
KBookmarks KUnitConversion KDE4Attic Kross)
#find_package(KF5Transitional REQUIRED)
# those are not "done" yet:
find_package(KIO REQUIRED NO_MODULE)
find_package(KDeclarative REQUIRED NO_MODULE)
# Needed for some includes from KDE/ (KMimeType, etc.)
# FIXME: remove when kdeui is fully split up
@ -66,11 +56,6 @@ find_package(KDELibs4 REQUIRED NO_MODULE)
# must be after KDELibs4, since it links against imported targets coming from KDELibs4Config.cmake:
find_package(KDE4Support REQUIRED NO_MODULE)
find_package(Qt5Transitional MODULE REQUIRED)
find_package(Qt5Quick REQUIRED NO_MODULE)
find_package(Qt5X11Extras REQUIRED NO_MODULE)
#optional features
find_package(X11 MODULE)
find_package(XCB MODULE COMPONENTS XCB COMPOSITE DAMAGE)
@ -136,7 +121,7 @@ set_package_properties(OpenGL PROPERTIES DESCRIPTION "The OpenGL libraries"
TYPE OPTIONAL
)
if(OPENGL_FOUND)
set(HAVE_GLX HAVE_X11)
set(HAVE_GLX ${HAVE_X11})
else()
set(HAVE_GLX 0)
endif()
@ -147,7 +132,6 @@ endif()
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
remove_definitions(-DQT3_SUPPORT_WARNINGS -DQT3_SUPPORT)
remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS)
if(QCA2_FOUND)

View File

@ -5,8 +5,8 @@ set(plasma_example_kpart_shell_SRCS
appletselector.cpp
)
kde4_add_ui_files(plasma_example_kpart_shell_SRCS appletselector.ui)
kde4_add_executable(plasma-example-kpart-shell ${plasma_example_kpart_shell_SRCS})
qt5_wrap_ui(plasma_example_kpart_shell_SRCS appletselector.ui)
add_executable(plasma-example-kpart-shell ${plasma_example_kpart_shell_SRCS})
target_link_libraries(plasma-example-kpart-shell ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} KF5::Plasma )

View File

@ -5,7 +5,7 @@ project(RunnerExample)
set(example_SRCS homefilesrunner.cpp)
# Now make sure all files get to the right place
kde4_add_plugin(plasma_runner_example_homefiles ${example_SRCS})
plasma_add_plugin(plasma_runner_example_homefiles ${example_SRCS})
target_link_libraries(plasma_runner_example_homefiles KF5::Plasma KF5::KIOCore KF5::KIOWidgets)
# Install the library and .desktop file

View File

@ -12,16 +12,14 @@ set(calendar_SRCS
daysmodel.cpp
)
qt4_automoc(${calendar_SRCS})
add_library(calendarplugin SHARED ${calendar_SRCS})
target_link_libraries(calendarplugin
Qt5::Core
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${QT_QTGUI_LIBRARY}
${QT_QTDECLARATIVE_LIBRARY}
Qt5::Gui
Qt5::Declarative
${KDEPIMLIBS_AKONADI_LIBS}
${KDEPIMLIBS_KCALCORE_LIBS}
${KDEPIMLIBS_AKONADI_CALENDAR_LIBS}

View File

@ -1,6 +1,4 @@
#include <QDebug>
#include <QListView>
#include <QTreeView>
#include "calendar.h"

View File

@ -30,11 +30,11 @@ set(corebindings_SRCS
add_library(corebindingsplugin SHARED ${corebindings_SRCS})
target_link_libraries(corebindingsplugin
${QT_QTSCRIPT_LIBRARY}
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${KDeclarative_LIBRARIES}
${KCore_LIBRARIES}
Qt5::Script
Qt5::Quick
Qt5::Qml
KF5::KDeclarative
KF5::KCoreAddons
KF5::KIconThemes
KF5::KWindowSystem
Plasma)

View File

@ -11,12 +11,10 @@ add_executable(sortfiltermodeltest
${corebindings_SOURCE_DIR}/datasource.cpp
)
qt4_automoc(sortfiltermodeltest.cpp)
target_link_libraries(sortfiltermodeltest
Plasma
${QT_QTGUI_LIBRARY}
${QT_QTTEST_LIBRARY}
Qt5::Gui
Qt5::Test
${KDE4Support_LIBRARIES}
KF5::KI18n
Qt5::Qml
@ -33,7 +31,6 @@ ecm_mark_as_test(sortfiltermodeltest)
# ../runnermodel.cpp
# )
#qt4_automoc(${runnermodeltest_SRCS})
#add_executable(runnermodeltest ${runnermodeltest_SRCS})
#target_link_libraries(runnermodeltest ${QT_QTTEST_LIBRARY} ${plasma_LIBRARIES} plasma)
#target_link_libraries(runnermodeltest Qt5::Test ${plasma_LIBRARIES} plasma)
#ecm_mark_as_test(runnermodeltest)

View File

@ -10,10 +10,11 @@ set(declarativedragdrop_SRCS
add_library(draganddropplugin SHARED ${declarativedragdrop_SRCS})
target_link_libraries(draganddropplugin
${QT_QTCORE_LIBRARY}
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${QT_QTGUI_LIBRARY}
Qt5::Core
Qt5::Quick
Qt5::Qml
Qt5::Gui
Qt5::Widgets
)
install(TARGETS draganddropplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/draganddrop)

View File

@ -16,7 +16,7 @@ set(localebindings_SRCS
add_library(localebindingsplugin SHARED ${localebindings_SRCS})
target_link_libraries(localebindingsplugin
${QT_QTCORE_LIBRARY}
Qt5::Core
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${KCore_LIBRARIES}

View File

@ -16,10 +16,10 @@ set(plasmacomponents_SRCS
add_library(plasmacomponentsplugin SHARED ${plasmacomponents_SRCS})
target_link_libraries(plasmacomponentsplugin
${QT_QTCORE_LIBRARY}
Qt5::Core
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${QT_QTGUI_LIBRARY}
Qt5::Gui
${KDeclarative_LIBRARIES}
Plasma)

View File

@ -14,10 +14,10 @@ set(qtextracomponents_SRCS
add_library(qtextracomponentsplugin SHARED ${qtextracomponents_SRCS})
target_link_libraries(qtextracomponentsplugin
${QT_QTCORE_LIBRARY}
Qt5::Core
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${QT_QTGUI_LIBRARY}
Qt5::Gui
${KDeclarative_LIBRARIES}
KF5::KIconThemes
Plasma)

View File

@ -4,10 +4,9 @@ include(ECMMarkAsTest)
add_executable(fullmodelaccesstest columnproxymodeltest.cpp ../columnproxymodel.cpp ../../core/tests/modeltest.cpp)
target_link_libraries(fullmodelaccesstest
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTTEST_LIBRARY}
${KCore_LIBRARIES}
Qt5::Gui
Qt5::Test
KF5::KCoreAddons
${KDE4Support_LIBRARIES}
KF5::KI18n
)

View File

@ -19,11 +19,11 @@
#include <../tests/columnproxymodeltest.h>
#include <columnproxymodel.h>
#include <../../core/tests/modeltest.h>
#include <qtest_kde.h>
#include <qtest.h>
#include <QSignalSpy>
#include <QStandardItemModel>
QTEST_KDEMAIN_CORE(ColumnProxyModelTest)
QTEST_MAIN(ColumnProxyModelTest)
void ColumnProxyModelTest::testInit()
{

View File

@ -9,14 +9,14 @@ find_package(KCoreAddons REQUIRED)
MACRO(PLASMA_UNIT_TESTS)
FOREACH(_testname ${ARGN})
add_executable(${_testname} ${_testname}.cpp)
target_link_libraries(${_testname} ${QT_QTTEST_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}
target_link_libraries(${_testname} Qt5::Test Qt5::Declarative
Plasma KF5::KArchive KF5::KCoreAddons
KF5::KConfigGui
KF5::KI18n
KF5::KIOCore
KF5::KService)
KF5::KIOCore
KF5::KService)
if(QT_QTOPENGL_FOUND)
target_link_libraries(${_testname} ${QT_QTOPENGL_LIBRARY})
target_link_libraries(${_testname} Qt5::OpenGL)
endif(QT_QTOPENGL_FOUND)
add_test(plasma-${_testname} ${_testname})
ecm_mark_as_test(${_testname})
@ -32,12 +32,12 @@ PLASMA_UNIT_TESTS(
)
add_executable(storagetest storagetest.cpp ../private/storage.cpp ../private/storagethread.cpp)
target_link_libraries(storagetest ${QT_QTTEST_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTSQL_LIBRARY} KF5::KIOCore Plasma KF5::KCoreAddons )
target_link_libraries(storagetest Qt5::Test Qt5::Declarative Qt5::Sql KF5::KIOCore Plasma KF5::KCoreAddons )
add_test(plasma-storagetest storagetest)
ecm_mark_as_test(plasma-storagetest)
if(QT_QTOPENGL_FOUND)
target_link_libraries(storagetest ${QT_QTOPENGL_LIBRARY})
target_link_libraries(storagetest Qt5::OpenGL)
endif(QT_QTOPENGL_FOUND)
if(QCA2_FOUND)

View File

@ -9,7 +9,7 @@ include(KDE4Defaults)
set(test_SRCS
test.cpp
)
kde4_add_ui_files(test_SRCS config.ui)
qt5_wrap_ui(test_SRCS config.ui)
plasma_add_plugin(plasma_containmentactions_test ${test_SRCS})
target_link_libraries(plasma_containmentactions_test ${Plasma_LIBRARIES} KF5::KIOCore KF5::KIOWidgets)

View File

@ -3,7 +3,7 @@ set(
platformstatus.cpp
)
qt4_add_dbus_adaptor (
qt5_add_dbus_adaptor (
kded_platformstatus_SRCS
org.kde.platformstatus.xml
platformstatus.h PlatformStatus
@ -20,7 +20,7 @@ target_link_libraries(
KF5::KIOCore KF5::KIOWidgets
Qt5::DBus
Qt5::Quick
)
)
install( TARGETS kded_platformstatus DESTINATION ${PLUGIN_INSTALL_DIR} )
install( FILES kded_platformstatus.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded )

View File

@ -55,10 +55,10 @@ target_link_libraries(plasma_appletscript_simple_javascript
${KCore_LIBRARIES}
KF5::KIOCore KF5::KIOWidgets
${Plasma_LIBRARIES}
${QT_QTDECLARATIVE_LIBRARY}
Qt5::Declarative
${QT_QTSCRIPT_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
${QT_QTXML_LIBRARY}
Qt5::Xml
)
install(TARGETS plasma_appletscript_simple_javascript DESTINATION ${PLUGIN_INSTALL_DIR})