how to build kate with cmake?

503 Views Asked by At

Dear stackoverflow users,

I'm trying to compile kate from source but I'm getting an error with a not declared variable. So far these are the commands I'm using:

#! /bin/bash
cmake \  
-D CMAKE_BUILD_TYPE=RelWithDebInfo \  
-D CMAKE_INSTALL_PREFIX=~/kde/usr \  
-D KDE_INSTALL_USE_QT_SYS_PATHS:BOOL=ON \  
-D TARGET_include_directories:PATH="/usr/include/x86_64-linux-gnu/qt5/" \  
-D Qt5_INCLUDE_DIRS:PATH="/usr/include/x86_64-linux-gnu/qt5/" \  
-D Qt5_LIBRARY_DIRS:PATH="/usr/lib/x86_64-linux-gnu/qt5/" \  
../kate/  
make  
make install

Please find below the error during compiling: I think it has to be related with not including some path file that should be there which declares the variable QWidgetAction, however I'm not sure why, since I installed all required packages as per the website.

(qtbase5-dev qtscript5-dev extra-cmake-modules plasma-framework-dev libkf5crash-dev libkf5config-dev libkf5activities-dev kinit-dev kdoctools-dev libkf5i18n-dev libkf5parts-dev libkf5guiaddons-dev libkf5iconthemes-dev libkf5jobwidgets-dev kio-dev libkf5texteditor-dev libkf5windowsystem-dev libkf5xmlgui-dev libgit2-dev). The reason I'm compiling it is because I messed up with my original installed kate and I just can't load back all plugins, since my /.config kate folder is gone. Please any help is appreciated.

[ 69%] Automatic moc for target katecloseexceptplugin [ 69%] Built target katecloseexceptplugin_automoc [ 71%] Built target katecloseexceptplugin [ 71%] Automatic moc for target katesqlplugin [ 71%] Built target katesqlplugin_automoc [ 71%] Building CXX object addons/katesql/CMakeFiles/katesqlplugin.dir
/katesqlview.cpp.o /home/pablo/kde/kate/addons/katesql/katesqlview.cpp: In member function ‘void KateSQLView::setupActions()’:
/home/pablo/kde/kate/addons/katesql/katesqlview.cpp:141:3: error:
‘QWidgetAction’ was not declared in this scope QWidgetAction *wa = new QWidgetAction(this); ^ /home/pablo/kde/kate/addons/katesql/katesqlview.cpp:141:18: error: ‘wa’ was not declared in this scope QWidgetAction *wa = new QWidgetAction(this);
^ /home/pablo/kde/kate/addons/katesql/katesqlview.cpp:141:27: error: expected type-specifier before ‘QWidgetAction’
QWidgetAction wa = new QWidgetAction(this);
^ addons/katesql/CMakeFiles/katesqlplugin.dir/build.make:96: recipe for target
'addons/katesql/CMakeFiles/katesqlplugin.dir/katesqlview.cpp.o' failed make[2]:
[addons/katesql/CMakeFiles/katesqlplugin.dir/katesqlview.cpp.o]
Error 1 CMakeFiles/Makefile2:2439: recipe for target 'addons/katesql/CMakeFiles /katesqlplugin.dir/all' failed
make[1]: *
[addons/katesql/CMakeFiles/katesqlplugin.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2

1

There are 1 best solutions below

1
On

QWidgetAction is a part of Qt. Have you got the Qt libraries and headers properly in your path?

Header: #include