Browse Source

conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
Gregory Guy 5 months ago
parent
commit
eeefa496af
Signed by: gregory guy <g-gregory@gmx.fr> GPG Key ID: 6EFE0EF249A874C0
55 changed files with 293 additions and 0 deletions
  1. 76
    0
      CMakeLists.txt
  2. 45
    0
      ConfigureChecks.cmake
  3. 8
    0
      config.h.cmake
  4. 15
    0
      src/CMakeLists.txt
  5. 1
    0
      src/doc/CMakeLists.txt
  6. 1
    0
      src/doc/en/CMakeLists.txt
  7. 5
    0
      src/doc/man/CMakeLists.txt
  8. 53
    0
      src/doc/man/knetstats.1
  9. 38
    0
      src/src/CMakeLists.txt
  10. 6
    0
      src/src/pics/CMakeLists.txt
  11. 1
    0
      translations/CMakeLists.txt
  12. 1
    0
      translations/bg/CMakeLists.txt
  13. 1
    0
      translations/bg/messages/CMakeLists.txt
  14. 1
    0
      translations/br/CMakeLists.txt
  15. 1
    0
      translations/br/messages/CMakeLists.txt
  16. 1
    0
      translations/cs/CMakeLists.txt
  17. 1
    0
      translations/cs/messages/CMakeLists.txt
  18. 1
    0
      translations/da/CMakeLists.txt
  19. 1
    0
      translations/da/messages/CMakeLists.txt
  20. 1
    0
      translations/de/CMakeLists.txt
  21. 1
    0
      translations/de/messages/CMakeLists.txt
  22. 1
    0
      translations/el/CMakeLists.txt
  23. 1
    0
      translations/el/messages/CMakeLists.txt
  24. 1
    0
      translations/es/CMakeLists.txt
  25. 1
    0
      translations/es/messages/CMakeLists.txt
  26. 1
    0
      translations/et/CMakeLists.txt
  27. 1
    0
      translations/et/messages/CMakeLists.txt
  28. 1
    0
      translations/fr/CMakeLists.txt
  29. 1
    0
      translations/fr/messages/CMakeLists.txt
  30. 1
    0
      translations/ga/CMakeLists.txt
  31. 1
    0
      translations/ga/messages/CMakeLists.txt
  32. 1
    0
      translations/gl/CMakeLists.txt
  33. 1
    0
      translations/gl/messages/CMakeLists.txt
  34. 1
    0
      translations/it/CMakeLists.txt
  35. 1
    0
      translations/it/messages/CMakeLists.txt
  36. 1
    0
      translations/ja/CMakeLists.txt
  37. 1
    0
      translations/ja/messages/CMakeLists.txt
  38. 1
    0
      translations/ka/CMakeLists.txt
  39. 1
    0
      translations/ka/messages/CMakeLists.txt
  40. 1
    0
      translations/nl/CMakeLists.txt
  41. 1
    0
      translations/nl/messages/CMakeLists.txt
  42. 1
    0
      translations/pl/CMakeLists.txt
  43. 1
    0
      translations/pl/messages/CMakeLists.txt
  44. 1
    0
      translations/pt/CMakeLists.txt
  45. 1
    0
      translations/pt/messages/CMakeLists.txt
  46. 1
    0
      translations/pt_BR/CMakeLists.txt
  47. 1
    0
      translations/pt_BR/messages/CMakeLists.txt
  48. 1
    0
      translations/ru/CMakeLists.txt
  49. 1
    0
      translations/ru/messages/CMakeLists.txt
  50. 1
    0
      translations/sk/CMakeLists.txt
  51. 1
    0
      translations/sk/messages/CMakeLists.txt
  52. 1
    0
      translations/sv/CMakeLists.txt
  53. 1
    0
      translations/sv/messages/CMakeLists.txt
  54. 1
    0
      translations/tr/CMakeLists.txt
  55. 1
    0
      translations/tr/messages/CMakeLists.txt

+ 76
- 0
CMakeLists.txt View File

@@ -0,0 +1,76 @@
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( knetstats )
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_TRANSLATIONS translations ) 
72
+
73
+
74
+##### write configure files
75
+
76
+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@

+ 15
- 0
src/CMakeLists.txt View File

@@ -0,0 +1,15 @@
1
+add_subdirectory( src )
2
+tde_conditional_add_subdirectory( BUILD_DOC doc )
3
+
4
+
5
+##### icons
6
+
7
+tde_install_icons( ${PROJECT_NAME} )
8
+
9
+
10
+##### other data
11
+
12
+install(
13
+    FILES ${PROJECT_NAME}.desktop
14
+    DESTINATION ${XDG_APPS_INSTALL_DIR}
15
+)

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

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

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

@@ -0,0 +1 @@
1
+tde_create_handbook( DESTINATION ${PROJECT_NAME} )

+ 5
- 0
src/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
+)

+ 53
- 0
src/doc/man/knetstats.1 View File

@@ -0,0 +1,53 @@
1
+'\" -*- coding: us-ascii -*-
2
+.if \n(.g .ds T< \\FC
3
+.if \n(.g .ds T> \\F[\n[.fam]]
4
+.de URL
5
+\\$2 \(la\\$1\(ra\\$3
6
+..
7
+.if \n(.g .mso www.tmac
8
+.TH knetstats 1 "16 Oct 2005" "" ""
9
+.SH NAME
10
+knetstats \- A system tray icon, which indicates network activity
11
+.SH SYNOPSIS
12
+'nh
13
+.fi
14
+.ad l
15
+\fBknetstats\fR \kx
16
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
17
+'in \n(.iu+\nxu
18
+[\fB--help \fIPrint options to console.\fB\fR]
19
+'in \n(.iu-\nxu
20
+.ad b
21
+'hy
22
+.SH DESCRIPTION
23
+This manual page documents briefly the
24
+\fBknetstats\fR
25
+commands.
26
+.PP
27
+This manual page was written for the Debian distribution.
28
+Instead, it has documentation in the GNU
29
+Info format; see below.
30
+.PP
31
+\fBknetstats\fR is a program that provides a system tray icon. This icon provides two
32
+LED's, which begin to blink if there is network traffic.
33
+.SH OPTIONS
34
+These programs follow the usual GNU command line syntax,
35
+with long options starting with two dashes (`-'). A summary of
36
+options is included below. For a complete description, see the
37
+Info files.
38
+.TP 
39
+\*(T<\fB\-h\fR\*(T> \*(T<\fB\-\-help\fR\*(T> 
40
+Show summary of options.
41
+.TP 
42
+\*(T<\fB\-v\fR\*(T> \*(T<\fB\-\-version\fR\*(T> 
43
+Show version of program.
44
+.SH "SEE ALSO"
45
+.SH AUTHOR
46
+This manual page was written by windheus <\*(T<thomas@0x5c.net\*(T>> for
47
+the Debian system (but may be used by others). Permission is
48
+granted to copy, distribute and/or modify this document under
49
+the terms of the GNU General Public License, Version 2 any 
50
+later version published by the Free Software Foundation.
51
+.PP
52
+On Debian systems, the complete text of the GNU General Public
53
+License can be found in /usr/share/common-licenses/GPL.

+ 38
- 0
src/src/CMakeLists.txt View File

@@ -0,0 +1,38 @@
1
+add_subdirectory( pics )
2
+
3
+include_directories(
4
+  ${CMAKE_BINARY_DIR}
5
+  ${CMAKE_CURRENT_BINARY_DIR}
6
+  ${CMAKE_CURRENT_SOURCE_DIR}
7
+  ${TDE_INCLUDE_DIR}
8
+  ${TQT_INCLUDE_DIRS}
9
+)
10
+
11
+link_directories(
12
+  ${TQT_LIBRARY_DIRS}
13
+  ${TDE_LIB_DIR}
14
+)
15
+
16
+
17
+##### knetstats (executable)
18
+
19
+tde_add_executable( ${PROJECT_NAME} AUTOMOC
20
+
21
+  SOURCES
22
+        configurebase.ui
23
+        configure.cpp
24
+        statisticsbase.ui
25
+        main.cpp
26
+        knetstats.cpp
27
+        knetstatsview.cpp
28
+        statistics.cpp
29
+        chart.cpp
30
+        interface.cpp
31
+  LINK
32
+     tdecore-shared
33
+     tdeui-shared
34
+     tdeio-shared
35
+     tdeui-shared
36
+     
37
+  DESTINATION ${BIN_INSTALL_DIR}
38
+)

+ 6
- 0
src/src/pics/CMakeLists.txt View File

@@ -0,0 +1,6 @@
1
+file( GLOB _pics RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.png )
2
+
3
+install(
4
+    FILES ${_pics}
5
+    DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/pics
6
+)

+ 1
- 0
translations/CMakeLists.txt View File

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

+ 1
- 0
translations/bg/CMakeLists.txt View File

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

+ 1
- 0
translations/bg/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG bg )

+ 1
- 0
translations/br/CMakeLists.txt View File

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

+ 1
- 0
translations/br/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG br )

+ 1
- 0
translations/cs/CMakeLists.txt View File

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

+ 1
- 0
translations/cs/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG cs )

+ 1
- 0
translations/da/CMakeLists.txt View File

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

+ 1
- 0
translations/da/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG da )

+ 1
- 0
translations/de/CMakeLists.txt View File

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

+ 1
- 0
translations/de/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG de )

+ 1
- 0
translations/el/CMakeLists.txt View File

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

+ 1
- 0
translations/el/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG el )

+ 1
- 0
translations/es/CMakeLists.txt View File

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

+ 1
- 0
translations/es/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG es )

+ 1
- 0
translations/et/CMakeLists.txt View File

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

+ 1
- 0
translations/et/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG et )

+ 1
- 0
translations/fr/CMakeLists.txt View File

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

+ 1
- 0
translations/fr/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG fr )

+ 1
- 0
translations/ga/CMakeLists.txt View File

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

+ 1
- 0
translations/ga/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG ga )

+ 1
- 0
translations/gl/CMakeLists.txt View File

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

+ 1
- 0
translations/gl/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG gl )

+ 1
- 0
translations/it/CMakeLists.txt View File

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

+ 1
- 0
translations/it/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG it )

+ 1
- 0
translations/ja/CMakeLists.txt View File

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

+ 1
- 0
translations/ja/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG ja )

+ 1
- 0
translations/ka/CMakeLists.txt View File

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

+ 1
- 0
translations/ka/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG ka )

+ 1
- 0
translations/nl/CMakeLists.txt View File

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

+ 1
- 0
translations/nl/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG nl )

+ 1
- 0
translations/pl/CMakeLists.txt View File

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

+ 1
- 0
translations/pl/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG pl )

+ 1
- 0
translations/pt/CMakeLists.txt View File

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

+ 1
- 0
translations/pt/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG pt )

+ 1
- 0
translations/pt_BR/CMakeLists.txt View File

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

+ 1
- 0
translations/pt_BR/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG pt_BR )

+ 1
- 0
translations/ru/CMakeLists.txt View File

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

+ 1
- 0
translations/ru/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG ru )

+ 1
- 0
translations/sk/CMakeLists.txt View File

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

+ 1
- 0
translations/sk/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG sk )

+ 1
- 0
translations/sv/CMakeLists.txt View File

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

+ 1
- 0
translations/sv/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG sv )

+ 1
- 0
translations/tr/CMakeLists.txt View File

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

+ 1
- 0
translations/tr/messages/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+tde_create_translation( LANG tr )

Loading…
Cancel
Save