[rkward/frameworks] /: KF5 porting: First steps

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Jun 1 09:26:56 UTC 2015


Git commit 5790b46b7f0fad59c8ba357e1df3da9470beb02c by Thomas Friedrichsmeier.
Committed on 13/05/2015 at 12:19.
Pushed by tfry into branch 'frameworks'.

KF5 porting: First steps

M  +12   -6    CMakeLists.txt
M  +2    -2    rkward/CMakeLists.txt
M  +1    -1    rkward/rbackend/CMakeLists.txt

http://commits.kde.org/rkward/5790b46b7f0fad59c8ba357e1df3da9470beb02c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 218b1b7..8c6cec2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,22 @@
 PROJECT(rkward)
 
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4)	# KDElibs seems to need 2.6, though
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)	# As required by KF5
 
 IF(NOT CMAKE_VERBOSE_MAKEFILE)
 	SET (FORCE_PRETTY_MAKEFILE ON)
 ENDIF(NOT CMAKE_VERBOSE_MAKEFILE)
 
-SET(KDE_MIN_VERSION 3.9.7)	# KDE 4.0rc2
-FIND_PACKAGE(KDE4 REQUIRED)
+FIND_PACKAGE(ECM 0.0.11 REQUIRED NO_MODULE)
 FIND_PACKAGE(Gettext REQUIRED)
+SET(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+
+INCLUDE(KDEInstallDirs)
+INCLUDE(KDECMakeSettings)
+INCLUDE(KDECompilerSettings)
+INCLUDE(FeatureSummary)
+
+FIND_PACKAGE(Qt5 5.2 CONFIG REQUIRED COMPONENTS Widgets Xml Network WebKit)
+FIND_PACKAGE(KF5 5.0 REQUIRED COMPONENTS CoreAddons)
 
 IF(FORCE_PRETTY_MAKEFILE)
 	SET(CMAKE_VERBOSE_MAKEFILE OFF)
@@ -18,11 +26,9 @@ ADD_DEFINITIONS(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DQT_NO_CAST_TO_ASCII)
 #uncomment the line below to save ~250-350kB in object size
 #ADD_DEFINITIONS(-DRKWARD_NO_TRACE)
 
-LINK_DIRECTORIES(${KDE4_LIB_DIR})
-
 ADD_SUBDIRECTORY(rkward)
 ADD_SUBDIRECTORY(i18n)
 ADD_SUBDIRECTORY(doc)
 ADD_SUBDIRECTORY(tests)
 
-# TODO: figure out how to make source distributions (with README files, etc.)
+FEATURE_SUMMARY(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/rkward/CMakeLists.txt b/rkward/CMakeLists.txt
index 8f06483..5d270bd 100644
--- a/rkward/CMakeLists.txt
+++ b/rkward/CMakeLists.txt
@@ -63,7 +63,7 @@ IF(Q_WS_MAC)
 		@ONLY)
 ENDIF(Q_WS_MAC)
 
-TARGET_LINK_LIBRARIES(rkward.frontend ${KDE4_KDECORE_LIBS} windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc ${KDE4_KTEXTEDITOR_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KDEWEBKIT_LIBS} ${QT_QTDBUS_LIBRARY} ${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${GETTEXT_LIBRARIES})
+TARGET_LINK_LIBRARIES(rkward.frontend  windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc KF5::TextEditor ${KDE4_KFILE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KDEWEBKIT_LIBS} Qt5::DBus ${QT_QTSCRIPT_LIBRARY} Qt5::Network ${GETTEXT_LIBRARIES})
 
 # wrapper executable
 GET_DIRECTORY_PROPERTY(R_EXECUTABLE DIRECTORY rbackend DEFINITION R_EXECUTABLE)
@@ -80,7 +80,7 @@ add_definitions ("-DR_EXECUTABLE=\\\"${R_EXECUTABLE}\\\"")
 add_definitions ("-DINSTALL_PATH=\\\"${CMAKE_INSTALL_PREFIX}\\\"")
 add_definitions ("-DR_LIBS=\\\"${R_LIBDIR}\\\"")
 add_definitions ("-DRKWARD_FRONTEND_LOCATION=\\\"${RKWARD_FRONTEND_LOCATION}\\\"")
-TARGET_LINK_LIBRARIES(rkward ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY})
+TARGET_LINK_LIBRARIES(rkward Qt5::Gui Qt5::Core Qt5::DBus)
 
 ADD_DEPENDENCIES(rkward.frontend rkward)
 
diff --git a/rkward/rbackend/CMakeLists.txt b/rkward/rbackend/CMakeLists.txt
index 83fec80..fb13b06 100644
--- a/rkward/rbackend/CMakeLists.txt
+++ b/rkward/rbackend/CMakeLists.txt
@@ -58,7 +58,7 @@ QT4_AUTOMOC(${rbackend_BACKEND_SRCS})
 ADD_DEFINITIONS (-DRKWARD_SPLIT_PROCESS)
 LINK_DIRECTORIES(${R_SHAREDLIBDIR})
 ADD_EXECUTABLE(rkward.rbackend ${rbackend_BACKEND_SRCS})
-TARGET_LINK_LIBRARIES(rkward.rbackend rkgraphicsdevice.backend ${R_USED_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY} ${GETTEXT_LIBRARIES} )
+TARGET_LINK_LIBRARIES(rkward.rbackend rkgraphicsdevice.backend ${R_USED_LIBS} ${CMAKE_THREAD_LIBS_INIT} Qt5::Network Qt5::Core ${GETTEXT_LIBRARIES} )
 
 IF(WIN32)
 	# on Widows, we install to the rbackend subdirectory, because 1) LIBEXEC_INSTALL_DIR == BIN_INSTALL_DIR and 2) we don't want the backend to pick up



More information about the rkward-tracker mailing list