Improve porting scripts

Prefer lowercase commands
Add cmake variables translations
Disable kde4_add_ui_files translation, we don't have a good macro for this
yet.
This commit is contained in:
Aleix Pol 2013-11-15 16:22:50 +01:00
parent 7088c9eb0d
commit e9d7e823ef
2 changed files with 19 additions and 2 deletions

View File

@ -1,4 +1,8 @@
for FS in `find $PWD -type f -name 'CMakeLists.txt'`; do
#all commands should be lowercase
#http://techbase.kde.org/Policies/CMake_Coding_Style#Upper.2Flower_casing
perl -p -i -e 's/^( *)([0-9A-Z_]*)( *)\(/$1.lc($2).$3."("/ge' $FS
#removes the predicate of endif and else in cmake
# http://techbase.kde.org/Policies/CMake_Coding_Style#End_commands
perl -p -i -e 's/endif( *)\(.*\)/endif\1()/g' $FS

View File

@ -13,7 +13,8 @@
for FS in `find $PWD -type f -name 'CMakeLists.txt'`; do
perl -p -i -e 's/plasma_add_plugin\(([a-zA-Z_\-]+) /add_library(\1 MODULE /g' $FS
perl -p -i -e 's/kde4_add_plugin\(([a-zA-Z_\-]+) /add_library(\1 MODULE /g' $FS
perl -p -i -e 's/kde4_add_ui_files/qt5_wrap_ui/g' $FS
# perl -p -i -e 's/kde4_add_ui_files/qt5_wrap_ui/g' $FS #TODO: need a ki18n_wrap_ui, otherwise changes in the cpp files are needed
perl -p -i -e 's/qt4_wrap_ui/qt5_wrap_ui/g' $FS
perl -p -i -e 's/kde4_add_kdeinit_executable/kf5_add_kdeinit_executable/g' $FS
perl -p -i -e 's/kde4_add_library/add_library/g' $FS
perl -p -i -e 's/kde4_add_executable/add_executable/g' $FS
@ -26,9 +27,10 @@ for FS in `find $PWD -type f -name 'CMakeLists.txt'`; do
perl -p -i -e 's/\$\{KDE4_PLASMA_LIBS\}/KF5::Plasma/g' $FS
perl -p -i -e 's/\$\{KDE4_KDECORE_LIBS\}//g' $FS
perl -p -i -e 's/\$\{KDE4_SOLID_LIBS\}/KF5\:\:Solid/g' $FS
perl -p -i -e 's/\$\{KDE4_KIO_LIBS\}/KF5\:\:KIOCore\ KF5\:\:KIOWidgets/g' $FS
perl -p -i -e 's/\$\{KDE4_KIO_LIBS\}/KF5\:\:KIOWidgets/g' $FS
perl -p -i -e 's/\$\{KDE4_KNOTIFYCONFIG_LIBRARY\}/KF5\:\:KNotifyConfig/g' $FS
perl -p -i -e 's/\$\{KDE4_KNEWSTUFF3_LIBRARY\}/KF5\:\:KNewStuff/g' $FS
perl -p -i -e 's/\$\{KDE4_KNEWSTUFF3_LIBS\}/KF5\:\:KNewStuff/g' $FS
perl -p -i -e 's/\$\{KDE4_KDESU_LIBS\}/KF5\:\:KDESu/g' $FS
perl -p -i -e 's/\$\{KDE4_KTEXTEDITOR_LIBS\}/KF5\:\:KTextEditor/g' $FS
perl -p -i -e 's/\$\{KDE4_KPTY_LIBS\}/KF5\:\:KPty/g' $FS
@ -37,6 +39,12 @@ for FS in `find $PWD -type f -name 'CMakeLists.txt'`; do
perl -p -i -e 's/\$\{KCoreAddons_LIBRARIES\}/KF5\:\:KCoreAddons/g' $FS
perl -p -i -e 's/\$\{KI18n_LIBRARIES\}/KF5\:\:KI18n/g' $FS
perl -p -i -e 's/\$\{KArchive_LIBRARIES\}/KF5\:\:KArchive/g' $FS
perl -p -i -e 's/\$\{Plasma_LIBRARIES\}/KF5\:\:Plasma/g' $FS
perl -p -i -e 's/\$\{KNotifications_LIBRARIES\}/KF5\:\:KNotifications/g' $FS
perl -p -i -e 's/\$\{KIconThemes_LIBRARIES\}/KF5\:\:KIconThemes/g' $FS
perl -p -i -e 's/\$\{KWindowSystem_LIBRARIES\}/KF5\:\:KWindowSystem/g' $FS
perl -p -i -e 's/\$\{KConfigWidgets_LIBRARIES\}/KF5\:\:KConfigWidgets/g' $FS
perl -p -i -e 's/\$\{QT_QTXML_LIBRARY\}/Qt5\:\:Xml/g' $FS
perl -p -i -e 's/\$\{QT_QTGUI_LIBRARY\}/Qt5\:\:Gui/g' $FS
perl -p -i -e 's/\$\{QT_QTNETWORK_LIBRARY\}/Qt5\:\:Network/g' $FS
@ -45,6 +53,11 @@ for FS in `find $PWD -type f -name 'CMakeLists.txt'`; do
perl -p -i -e 's/\$\{QT_QTTEST_LIBRARY\}/Qt5\:\:Test/g' $FS
perl -p -i -e 's/\$\{QT_QTSVG_LIBRARY\}/Qt5\:\:Svg/g' $FS
perl -p -i -e 's/\$\{QT_QTOPENGL_LIBRARY\}/Qt5\:\:OpenGL/g' $FS
perl -p -i -e 's/\$\{QT_QTSQL_LIBRARY\}/Qt5\:\:Sql/g' $FS
perl -p -i -e 's/\$\{QT_QTDBUS_LIBRARY\}/Qt5\:\:DBus/g' $FS
perl -p -i -e 's/\$\{Qt5DBus_LIBRARIES\}/Qt5\:\:DBus/g' $FS
perl -p -i -e 's/\$\{Qt5Quick_LIBRARIES\}/Qt5\:\:Quick/g' $FS
perl -p -i -e 's/\$\{Qt5Qml_LIBRARIES\}/Qt5\:\:Qml/g' $FS
perl -p -i -e 's/\$\{Qt5Widgets_LIBRARIES\}/Qt5\:\:Widgets/g' $FS
done