Browse Source

conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
Gregory Guy 4 months ago
parent
commit
9004ae5427
Signed by: Slávek Banko <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668

+ 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( knowit )
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  )
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( src )
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 )

+ 44
- 0
ConfigureChecks.cmake View File

@@ -0,0 +1,44 @@
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 )

+ 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
+tde_create_handbook( DESTINATION ${PROJECT_NAME} ) 

+ 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
+)

+ 51
- 0
doc/man/knowit.1 View File

@@ -0,0 +1,51 @@
1
+.\"                                      Hey, EMACS: -*- nroff -*-
2
+.TH KNOWIT 1 "Aug 24, 2006"
3
+.SH NAME
4
+knowit \- Tool for managing notes for TDE
5
+.SH SYNOPSIS
6
+.B knowit
7
+.RI [ options ]
8
+.SH DESCRIPTION
9
+This manual page documents briefly the
10
+.B knowit
11
+command.
12
+.PP
13
+\fBKnowIt\fP is a tool for managing notes which are organized in
14
+tree-like hierarchy. It is similar to TuxCards,
15
+but TDE-based (it requires Trinity Desktop Environment).
16
+.SH OPTIONS
17
+These programs follow the usual GNU command line syntax, with long
18
+options starting with two dashes (`-').
19
+A summary of options is included below.
20
+For a complete description, see the Info files.
21
+.TP
22
+.B \-\-help
23
+Show help about options
24
+.TP
25
+.B \-\-help-qt
26
+Show Qt specific options
27
+.TP
28
+.B \-\-help-tde
29
+Show TDE specific options
30
+.TP
31
+.B \-\-help-all
32
+Show all options
33
+.TP
34
+.B \-\-author
35
+Show author information
36
+.TP
37
+.B \-v, \-\-version
38
+Show version information
39
+.TP
40
+.B \-\-license
41
+Show license information
42
+.TP
43
+.B \-\-
44
+End of options
45
+.TP
46
+.br
47
+.SH AUTHOR
48
+knowit was written by Micha Rudolf
49
+.PP
50
+This manual page was written by Lorenzo Villani <arbiter@arbiterlab.net>,
51
+for the Ubuntu project (but may be used by others).

+ 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


+ 61
- 0
src/CMakeLists.txt View File

@@ -0,0 +1,61 @@
1
+include_directories(
2
+  ${CMAKE_BINARY_DIR}
3
+  ${CMAKE_CURRENT_BINARY_DIR}
4
+  ${CMAKE_CURRENT_SOURCE_DIR}
5
+  ${TDE_INCLUDE_DIR}
6
+  ${TQT_INCLUDE_DIRS}
7
+)
8
+
9
+link_directories(
10
+  ${TQT_LIBRARY_DIRS}
11
+  ${TDE_LIB_DIR}
12
+)
13
+
14
+
15
+##### knowit (executable)
16
+
17
+tde_add_executable( ${PROJECT_NAME} AUTOMOC
18
+
19
+  SOURCES
20
+        main.cpp
21
+        knowit.cpp
22
+        notes.cpp
23
+        knowittree.cpp
24
+        knowitlinks.cpp
25
+        knowittray.cpp
26
+        knowitpref.cpp
27
+        knowitlink.cpp
28
+        knowitapp.cpp
29
+        knowitchooser.cpp
30
+        knowitedit.cpp
31
+  LINK
32
+     tdecore-shared
33
+     tdeui-shared
34
+     tdeio-shared
35
+     tdeprint-shared
36
+     
37
+  DESTINATION ${BIN_INSTALL_DIR}
38
+)
39
+
40
+
41
+##### icons
42
+
43
+tde_install_icons( ${PROJECT_NAME} )
44
+
45
+
46
+##### other data
47
+
48
+install(
49
+    FILES knowitui.rc tips
50
+    DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
51
+)
52
+
53
+install(
54
+    FILES ${PROJECT_NAME}.desktop
55
+    DESTINATION ${XDG_APPS_INSTALL_DIR}
56
+)
57
+
58
+install(
59
+    FILES x-${PROJECT_NAME}.desktop
60
+    DESTINATION ${MIME_INSTALL_DIR}/application
61
+)

+ 1
- 0
src/knowit.cpp View File

@@ -1326,3 +1326,4 @@ void Knowit::slotLinkCopy()
1326 1326
    kapp->clipboard()->setText(link.link, TQClipboard::Selection);
1327 1327
 }
1328 1328
 
1329
+#include "knowit.moc"

+ 1
- 1
src/knowit.desktop View File

@@ -3,7 +3,7 @@ Encoding=UTF-8
3 3
 Type=Application
4 4
 Exec=knowit -caption "%c" %i %m
5 5
 MimeType=application/x-knowit
6
-Icon=knowit
6
+Icon=desktop
7 7
 X-DocPath=knowit/index.html
8 8
 Comment=
9 9
 Comment[de]=

+ 2
- 0
src/knowitapp.cpp View File

@@ -31,3 +31,5 @@ void KnowitApplication::commitData(TQSessionManager& sm)
31 31
    mcloseByLogout = true;
32 32
    KUniqueApplication::commitData(sm);
33 33
 }
34
+
35
+#include "knowitapp.moc"

+ 2
- 0
src/knowitchooser.cpp View File

@@ -83,3 +83,5 @@ void KnowitChooser::setChoice(int flags)
83 83
    rule->setChecked(flags & AddRule);
84 84
    style->setChecked(flags & Style);
85 85
 }
86
+
87
+#include "knowitchooser.moc"

+ 1
- 0
src/knowitedit.cpp View File

@@ -64,3 +64,4 @@ void KnowitEdit::contentsDropEvent(TQDropEvent* event)
64 64
    else TQTextEdit::contentsDropEvent(event);
65 65
 }
66 66
 
67
+#include "knowitedit.moc"

+ 1
- 0
src/knowitlink.cpp View File

@@ -99,3 +99,4 @@ void KnowitLinkDialog::slotTypeChanged(int index)
99 99
    browse->setEnabled(!index);
100 100
 }
101 101
 
102
+#include "knowitlink.moc"

+ 2
- 0
src/knowitlinks.cpp View File

@@ -54,3 +54,5 @@ void KnowitLinks::keyPressEvent(TQKeyEvent* e)
54 54
       }
55 55
    else TDEListBox::keyPressEvent(e);
56 56
 }
57
+
58
+#include "knowitlinks.moc"

+ 1
- 1
src/knowitpref.cpp View File

@@ -389,4 +389,4 @@ void KnowitPreferences::slotUpdateDatePreview()
389 389
    insertDatePreview->setText(str);
390 390
 }
391 391
 
392
-
392
+#include "knowitpref.moc"

+ 1
- 1
src/knowittree.cpp View File

@@ -142,5 +142,5 @@ void KnowitTree::slotItemRight()
142 142
       setCurrentItem(currentItem()->firstChild());
143 143
 }
144 144
 
145
-
145
+#include "knowittree.moc"
146 146
 

+ 1
- 1
src/x-knowit.desktop View File

@@ -1,6 +1,6 @@
1 1
 [Desktop Entry]
2 2
 Comment=KnowIt
3
-Icon=knowit
3
+Icon=desktop
4 4
 MimeType=application/x-knowit
5 5
 Patterns=*.kno;
6 6
 Type=MimeType

Loading…
Cancel
Save