Browse Source

conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
Gregory Guy 3 months ago
parent
commit
ededcc28b4
Signed by: gregory guy <g-gregory@gmx.fr> GPG Key ID: 6EFE0EF249A874C0

+ 77
- 0
CMakeLists.txt View File

@@ -0,0 +1,77 @@
1
+############################################
2
+#                                          #
3
+#  Improvements and feedbacks are welcome  #
4
+#                                          #
5
+#  This file is released under GPL >= 3    #
6
+#                                          #
7
+############################################
8
+
9
+
10
+cmake_minimum_required( VERSION 2.8 )
11
+
12
+
13
+#### general package setup
14
+
15
+project( krename )
16
+set( VERSION R14.1.0 )
17
+
18
+
19
+#### include essential cmake modules
20
+
21
+include( FindPkgConfig          )
22
+include( CheckFunctionExists    )
23
+include( CheckIncludeFile       )
24
+include( CheckLibraryExists     )
25
+include( CheckCSourceCompiles   )
26
+include( CheckCXXSourceCompiles )
27
+
28
+
29
+#### include our cmake modules
30
+
31
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
32
+include( TDEMacros )
33
+
34
+
35
+##### setup install paths
36
+
37
+include( TDESetupPaths )
38
+tde_setup_paths( )
39
+
40
+
41
+##### optional stuff
42
+
43
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF                                          )
44
+option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
45
+
46
+
47
+##### user requested modules
48
+
49
+option( BUILD_ALL "Build all" ON                             )
50
+option( BUILD_DOC "Build documentation" ${BUILD_ALL}         )
51
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
52
+
53
+
54
+##### configure checks
55
+
56
+include( ConfigureChecks.cmake )
57
+
58
+
59
+###### global compiler settings
60
+
61
+add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST )
62
+
63
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
64
+set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
65
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
66
+
67
+
68
+##### directories
69
+
70
+add_subdirectory( ${PROJECT_NAME} )
71
+tde_conditional_add_subdirectory( BUILD_DOC doc         )
72
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) 
73
+
74
+
75
+##### write configure files
76
+
77
+configure_file( config.h.cmake config.h @ONLY )

+ 45
- 0
ConfigureChecks.cmake View File

@@ -0,0 +1,45 @@
1
+###########################################
2
+#                                         #
3
+#  Improvements and feedback are welcome  #
4
+#                                         #
5
+#  This file is released under GPL >= 3   #
6
+#                                         #
7
+###########################################
8
+
9
+
10
+# required stuff
11
+find_package( TQt )
12
+find_package( TDE )
13
+
14
+tde_setup_architecture_flags( )
15
+
16
+include(TestBigEndian)
17
+test_big_endian(WORDS_BIGENDIAN)
18
+
19
+
20
+##### check for gcc visibility support
21
+
22
+if( WITH_GCC_VISIBILITY )
23
+  if( NOT UNIX )
24
+    tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" )
25
+  endif( NOT UNIX )
26
+  set( __KDE_HAVE_GCC_VISIBILITY 1 )
27
+  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
28
+  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
29
+endif( WITH_GCC_VISIBILITY )
30
+
31
+
32
+##### gettext
33
+
34
+if( BUILD_TRANSLATIONS )
35
+  include( FindGettext )
36
+  if( GETTEXT_FOUND )
37
+    set( MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT_EXECUTABLE} 
38
+      CACHE FILEPATH "path to msgfmt executable" )
39
+  endif( GETTEXT_FOUND )
40
+  
41
+  if( NOT MSGFMT_EXECUTABLE )
42
+    tde_message_fatal( "msgfmt is required but was not found on your system." )
43
+  endif( NOT MSGFMT_EXECUTABLE )
44
+endif( BUILD_TRANSLATIONS )
45
+

+ 8
- 0
config.h.cmake View File

@@ -0,0 +1,8 @@
1
+#define VERSION "@VERSION@"
2
+
3
+// Defined if you have fvisibility and fvisibility-inlines-hidden support.
4
+#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
5
+
6
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
7
+   significant byte first (like Motorola and SPARC, unlike Intel). */
8
+#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@

+ 1
- 0
doc/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_auto_add_subdirectories( )

+ 1
- 0
doc/en/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+add_subdirectory( HTML )

+ 4
- 0
doc/en/HTML/CMakeLists.txt View File

@@ -0,0 +1,4 @@
1
+install(
2
+    FILES index.html
3
+    DESTINATION ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}
4
+)

+ 1
- 1
doc/en/HTML/index.html View File

@@ -43,7 +43,7 @@
43 43
         <div>
44 44
 	<p><h3>Introduction</h3></p>
45 45
 	<p>
46
-	KRename is a batch renamer or a mass renamer, how it is called by a few people, for KDE. A batch renamer takes a list of files and renames them all at once using a given set of expressions. KRename has lot's of features which makes the renaming easier. 
46
+	KRename is a batch renamer or a mass renamer, how it is called by a few people, for TDE. A batch renamer takes a list of files and renames them all at once using a given set of expressions. KRename has lot's of features which makes the renaming easier. 
47 47
 	</p>
48 48
 	<p>
49 49
 	First of all there is the powerful GUI with two GUI modes: One mode (called wizard-mode) is for first time KRename users witch only want to do simple tasks and the other mode (called tabbedmode) shows the full power of KRename and allows you to do allmost everything with your filenames. But there is much more than only the GUI. KRename supports all of the great KDE technologies, like TDEIO-Slaves, which allow to rename files almost everywhere (on ftp:// servers, over fish:// or on smb:// shares), DCOP, giving you easy scripting access to KRename, and the powerful KDE file plugins. Thanks to the file plugins of KDE, KRename can access information, such as the interpret of a mp3 or ogg file or the creation date of a jpeg image. 

+ 5
- 0
doc/man/CMakeLists.txt View File

@@ -0,0 +1,5 @@
1
+INSTALL(
2
+    FILES ${PROJECT_NAME}.1
3
+    DESTINATION ${MAN_INSTALL_DIR}/man1
4
+    COMPONENT doc
5
+)

+ 87
- 0
doc/man/krename.1 View File

@@ -0,0 +1,87 @@
1
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.35.
2
+.TH QT: "1" "September 2005" "Qt: 3.3.5" "User Commands"
3
+.SH NAME
4
+Qt: \- manual page for Qt: 3.3.5
5
+.SH SYNOPSIS
6
+.B krename
7
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIfile\fR]
8
+.SH DESCRIPTION
9
+KRename is a batch file renamer which can rename a
10
+list of files based on a set of expressions.
11
+.PP
12
+If you like KRename you may want to support it.
13
+Testing, bug fixes and feature request are as welcome
14
+as financial support (everybody needs money ;)
15
+See help files for details.
16
+.SS "Generic options:"
17
+.TP
18
+\fB\-\-help\fR
19
+Show help about options
20
+.TP
21
+\fB\-\-help\-qt\fR
22
+Show Qt specific options
23
+.TP
24
+\fB\-\-help\-tde\fR
25
+Show TDE specific options
26
+.TP
27
+\fB\-\-help\-all\fR
28
+Show all options
29
+.TP
30
+\fB\-\-author\fR
31
+Show author information
32
+.TP
33
+\fB\-v\fR, \fB\-\-version\fR
34
+Show version information
35
+.TP
36
+\fB\-\-license\fR
37
+Show license information
38
+.TP
39
+\fB\-\-\fR
40
+End of options
41
+.SS "Arguments:"
42
+.TP
43
+file
44
+file will be added to the list of files for renaming
45
+.SH OPTIONS
46
+.TP
47
+\fB\-r\fR +[dir]
48
+add directory recursively
49
+.TP
50
+\fB\-\-template\fR +
51
+set a template
52
+.TP
53
+\fB\-\-extension\fR +
54
+set a template for the file extension
55
+.TP
56
+\fB\-\-use\-plugin\fR +
57
+enable a plugin for use
58
+.TP
59
+\fB\-\-copy\fR +[dir]
60
+copy files to directory
61
+.TP
62
+\fB\-\-move\fR +[dir]
63
+move files to directory
64
+.TP
65
+\fB\-\-profile\fR +[profile]
66
+load the profile named [profile] on startup
67
+.TP
68
+\fB\-\-start\fR
69
+start renaming immediately
70
+.TP
71
+\fB\-\-nopreview\fR
72
+create no realtime preview
73
+.PP
74
+KDE: 3.4.2
75
+KRename: 3.0.8
76
+.SH "SEE ALSO"
77
+The full documentation for
78
+.B Qt:
79
+is maintained as a Texinfo manual.  If the
80
+.B info
81
+and
82
+.B Qt:
83
+programs are properly installed at your site, the command
84
+.IP
85
+.B info Qt:
86
+.PP
87
+should give you access to the complete manual.

+ 92
- 0
krename/CMakeLists.txt View File

@@ -0,0 +1,92 @@
1
+include_directories(
2
+  ${CMAKE_BINARY_DIR}
3
+  ${CMAKE_CURRENT_BINARY_DIR}
4
+  ${CMAKE_CURRENT_SOURCE_DIR}
5
+  ${CMAKE_SOURCE_DIR}/src
6
+  ${TDE_INCLUDE_DIR}
7
+  ${TQT_INCLUDE_DIRS}
8
+)
9
+
10
+link_directories(
11
+  ${TQT_LIBRARY_DIRS}
12
+  ${TDE_LIB_DIR}
13
+)
14
+
15
+
16
+##### krename (executable)
17
+
18
+tde_add_executable( ${PROJECT_NAME} AUTOMOC
19
+
20
+  SOURCES
21
+        guimodeselector.cpp
22
+        firststartdlg.cpp
23
+        tabs.cpp
24
+        krenameimpl.cpp
25
+        numberdialog.cpp
26
+        coorddialog.cpp
27
+        commandplugin.cpp
28
+        helpdialog.cpp
29
+        pictureplugin.cpp
30
+        mydirplugin.cpp
31
+        datetime.cpp
32
+        permission.cpp
33
+        fileplugin.cpp
34
+        undodialog.cpp
35
+        myinputdialog.cpp
36
+        kmylistview.cpp
37
+        wizard.cpp
38
+        replacedialog.cpp
39
+        pluginloader.cpp
40
+        plugin.cpp
41
+        kmylistbox.cpp
42
+        kmyhistorycombo.cpp
43
+        fileoperation.cpp
44
+        confdialog.cpp
45
+        batchrenamer.cpp
46
+        ProgressDialog.cpp
47
+        main.cpp
48
+        krecursivelister.cpp
49
+        dsdirselectdialog.cpp
50
+        krenamedcop.skel
51
+        dateplugin.cpp
52
+        encodingplugin.cpp
53
+        profiledlg.cpp
54
+        threadedlister.cpp
55
+        translitplugin.cpp
56
+  LINK
57
+     tdecore-shared
58
+     tdeui-shared
59
+     tdeio-shared
60
+     
61
+  DESTINATION ${BIN_INSTALL_DIR}
62
+)
63
+
64
+
65
+##### icons
66
+
67
+tde_install_icons( ${PROJECT_NAME} )
68
+
69
+
70
+##### other data
71
+
72
+install(
73
+    FILES ${PROJECT_NAME}.desktop
74
+    DESTINATION ${XDG_APPS_INSTALL_DIR}
75
+)
76
+
77
+install(
78
+    FILES
79
+        krenameservicemenu.desktop
80
+        krename_dir.desktop
81
+        
82
+    DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus
83
+)
84
+
85
+install(
86
+    FILES
87
+        logo.png
88
+        krename_system_default_tabbed.xml
89
+        krename_system_default_wizard.xml
90
+        
91
+  DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
92
+)

+ 2
- 0
krename/ProgressDialog.cpp View File

@@ -350,3 +350,5 @@ void ProgressDialog::slotTimer()
350 350
 {
351 351
     kapp->processEvents( 0 );
352 352
 }
353
+
354
+#include "ProgressDialog.moc"

+ 1
- 0
krename/commandplugin.cpp View File

@@ -189,3 +189,4 @@ const TQPixmap CommandPlugin::getIcon() const
189 189
     return kapp->iconLoader()->loadIcon( "konsole", TDEIcon::Small );
190 190
 }
191 191
 
192
+#include "commandplugin.moc"

+ 1
- 0
krename/confdialog.cpp View File

@@ -107,3 +107,4 @@ void ConfDialog::defaults()
107 107
     spinSize->setValue( 80 );
108 108
 }
109 109
 
110
+#include "confdialog.moc"

+ 2
- 0
krename/coorddialog.cpp View File

@@ -140,3 +140,5 @@ TQString CoordDialog::coords()
140 140
     m_inversion = checkInvert->isChecked();
141 141
     return m_command;
142 142
 }
143
+
144
+#include "coorddialog.moc"

+ 2
- 0
krename/dateplugin.cpp View File

@@ -151,3 +151,5 @@ void DatePlugin::addHelp( HelpDialogData* data )
151 151
 
152 152
     data->add( getName(), &list, getIcon() );
153 153
 }
154
+
155
+#include "dateplugin.moc"

+ 1
- 1
krename/datetime.cpp View File

@@ -234,5 +234,5 @@ void MyDatePlugin::changeDT()
234 234
     kDate->setDate( TQDate::currentDate() );
235 235
 }
236 236
 
237
-
237
+#include "datetime.moc"
238 238
 

+ 2
- 0
krename/encodingplugin.cpp View File

@@ -142,3 +142,5 @@ void EncodingPlugin::setLocale( KComboBox* combo )
142 142
 	    break;
143 143
 	}
144 144
 }
145
+
146
+#include "encodingplugin.moc"

+ 1
- 0
krename/fileoperation.cpp View File

@@ -110,3 +110,4 @@ void FileOperation::slotResult( TDEIO::Job * job )
110 110
     kapp->eventLoop()->exitLoop();
111 111
 }
112 112
 
113
+#include "fileoperation.moc"

+ 2
- 0
krename/fileplugin.cpp View File

@@ -211,3 +211,5 @@ void FilePlugin::clearCache()
211 211
 {
212 212
     cache.clear();
213 213
 }
214
+
215
+#include "fileplugin.moc"

+ 1
- 0
krename/firststartdlg.cpp View File

@@ -31,3 +31,4 @@ FirstStartDlg::~FirstStartDlg()
31 31
 {
32 32
 }
33 33
 
34
+#include "firststartdlg.moc"

+ 1
- 0
krename/helpdialog.cpp View File

@@ -149,3 +149,4 @@ void HelpDialog::updateHeadline()
149 149
             comboHeadline->insertItem( ic[it.key()], it.key() );    
150 150
 }
151 151
 
152
+#include "helpdialog.moc"

+ 2
- 0
krename/kmyhistorycombo.cpp View File

@@ -165,3 +165,5 @@ void KMyHistoryCombo::slotInsertKRenameCommand( int id )
165 165
     if( !t.isEmpty() )
166 166
         this->lineEdit()->insert( t );
167 167
 }
168
+
169
+#include "kmyhistorycombo.moc"

+ 1
- 0
krename/kmylistbox.cpp View File

@@ -837,3 +837,4 @@ TQString KMyListBoxItem::text() const
837 837
 bool KMyListBoxItem::m_preview = false;
838 838
 bool KMyListBoxItem::m_name = false;
839 839
 
840
+#include "kmylistbox.moc"

+ 1
- 0
krename/kmylistview.cpp View File

@@ -175,3 +175,4 @@ void KMyListViewItem::paintCell( TQPainter *p, const TQColorGroup &cg,
175 175
     _cg.setColor( TQColorGroup::Text, c );
176 176
 }
177 177
 
178
+#include "kmylistview.moc"

+ 2
- 0
krename/krenameimpl.cpp View File

@@ -1834,3 +1834,5 @@ void KRenameImpl::slotEasy4()
1834 1834
 {
1835 1835
     getHelpDialogString( comboCustomExtension->lineEdit() );
1836 1836
 }
1837
+
1838
+#include "krenameimpl.moc"

+ 1
- 0
krename/mydirplugin.cpp View File

@@ -167,3 +167,4 @@ void MyDirPlugin::chooseDir()
167 167
         outputdir->setText( s );
168 168
 }
169 169
 
170
+#include "mydirplugin.moc"

+ 1
- 0
krename/myinputdialog.cpp View File

@@ -107,3 +107,4 @@ void MyInputDialog::slotFilename()
107 107
     text->setText( m_oldfilename );
108 108
 }
109 109
 
110
+#include "myinputdialog.moc"

+ 2
- 0
krename/numberdialog.cpp View File

@@ -169,3 +169,5 @@ void NumberDialog::sort()
169 169
         }
170 170
     }
171 171
 }
172
+
173
+#include "numberdialog.moc"

+ 1
- 1
krename/permission.cpp View File

@@ -326,4 +326,4 @@ const TQPixmap MyPermPlugin::getIcon() const
326 326
     return kapp->iconLoader()->loadIcon( "clanbomber", TDEIcon::Small );
327 327
 }
328 328
 
329
-
329
+#include "permission.moc"

+ 1
- 1
krename/pictureplugin.cpp View File

@@ -95,4 +95,4 @@ TQString PicturePlugin::processFile( BatchRenamer* b, int i, TQString token, int
95 95
     return ret;
96 96
 }
97 97
 
98
-
98
+#include "pictureplugin.moc"

+ 2
- 0
krename/plugin.cpp View File

@@ -60,3 +60,5 @@ void Plugin::clearCache()
60 60
 {
61 61
     // do nothing...
62 62
 }
63
+
64
+#include "plugin.moc"

+ 2
- 0
krename/pluginloader.cpp View File

@@ -177,3 +177,5 @@ void PluginLoader::loadFilePlugins()
177 177
     
178 178
     m_file = true;
179 179
 }
180
+
181
+#include "pluginloader.moc"

+ 2
- 0
krename/replacedialog.cpp View File

@@ -255,3 +255,5 @@ void ReplaceDialog::slotEdit()
255 255
 
256 256
     enableControls();
257 257
 }
258
+
259
+#include "replacedialog.moc"

+ 2
- 0
krename/tabs.cpp View File

@@ -118,3 +118,5 @@ void tabs::keyPressEvent( TQKeyEvent *e )
118 118
     else
119 119
         e->ignore();
120 120
 }
121
+
122
+#include "tabs.moc"

+ 3
- 1
krename/translitplugin.cpp View File

@@ -10,7 +10,7 @@
10 10
 //
11 11
 //
12 12
 #include "translitplugin.h"
13
-#include "translitplugin.moc"
13
+
14 14
 
15 15
 const TQString TranslitPlugin::m_strUtf8[] = {"а","б","в","г","д","е","ё","ж","з","и",
16 16
     "й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь",
@@ -104,3 +104,5 @@ TranslitPlugin::TranslitPlugin() {
104 104
         m_mapFromUTF8[src] = dst;
105 105
     }
106 106
 }
107
+
108
+#include "translitplugin.moc"

+ 1
- 1
krename/undodialog.cpp View File

@@ -131,6 +131,6 @@ void UndoDialog::setUndoScript( const TQString & filename )
131 131
     scriptname->setURL( filename );
132 132
 }
133 133
     
134
-
134
+#include "undodialog.moc"
135 135
 
136 136
 

+ 1
- 0
krename/wizard.cpp View File

@@ -104,3 +104,4 @@ void wizard::accept()
104 104
 /** do nothing */
105 105
 }
106 106
 
107
+#include "wizard.moc"

+ 1
- 0
po/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} )

po/zh_CN.GB2312.po → po/zh_CN.po View File


po/zh_TW.Big5.po → po/zh_TW.po View File


Loading…
Cancel
Save