Przeglądaj źródła

converios to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/1/head
Gregory Guy 7 miesięcy temu
rodzic
commit
a63b9b15ca
Podpisane przez: Slávek Banko <slavek.banko@axis.cz> ID klucza GPG: 608F5293A04BE668

+ 93
- 0
CMakeLists.txt Wyświetl plik

@@ -0,0 +1,93 @@
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( kkbswitch )
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
+option( WITH_RU_UA_LAYOUT "Add Russian and Ukrainian keyboard"                  ${WITH_ALL_OPTIONS} )
46
+
47
+
48
+##### user requested modules
49
+
50
+option( BUILD_ALL "Build all" ON                                            )
51
+option( BUILD_DOC "Build documentation" ${BUILD_ALL}                        )
52
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL}                )
53
+
54
+
55
+##### configure checks
56
+
57
+include( ConfigureChecks.cmake )
58
+
59
+
60
+###### global compiler settings
61
+
62
+add_definitions( -DHAVE_CONFIG_H )
63
+
64
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
65
+set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
66
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
67
+
68
+
69
+##### directories
70
+
71
+add_subdirectory( ${PROJECT_NAME} )
72
+add_subdirectory( ${PROJECT_NAME}.upd )
73
+tde_conditional_add_subdirectory( BUILD_DOC doc         )
74
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) 
75
+
76
+
77
+##### man page
78
+
79
+INSTALL(
80
+    FILES ${PROJECT_NAME}.1
81
+    DESTINATION ${MAN_INSTALL_DIR}/man1
82
+    COMPONENT doc
83
+)
84
+
85
+
86
+##### icons
87
+
88
+tde_install_icons( ${PROJECT_NAME} )
89
+
90
+
91
+##### write configure files
92
+
93
+configure_file( config.h.cmake config.h @ONLY )

+ 56
- 0
ConfigureChecks.cmake Wyświetl plik

@@ -0,0 +1,56 @@
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
+#### check for libxkbfile
33
+
34
+pkg_search_module( XKBFILE xkbfile )
35
+if( NOT XKBFILE_FOUND )
36
+  tde_message_fatal( "xkbfile is required , but was not found on your system" )
37
+  else ( )
38
+    set( HAVE_X11_EXTENSIONS_XKBRULES_H 1 )
39
+    set( HAVE_LIBXKBFILE 1 )
40
+endif()
41
+
42
+
43
+##### gettext
44
+
45
+if( BUILD_TRANSLATIONS )
46
+  include( FindGettext )
47
+  if( GETTEXT_FOUND )
48
+    set( MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT_EXECUTABLE} 
49
+      CACHE FILEPATH "path to msgfmt executable" )
50
+  endif( GETTEXT_FOUND )
51
+  
52
+  if( NOT MSGFMT_EXECUTABLE )
53
+    tde_message_fatal( "msgfmt is required but was not found on your system." )
54
+  endif( NOT MSGFMT_EXECUTABLE )
55
+endif( BUILD_TRANSLATIONS )
56
+

+ 16
- 0
config.h.cmake Wyświetl plik

@@ -0,0 +1,16 @@
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@
9
+
10
+
11
+// Defined to 1 if we have libxkbfile library
12
+#cmakedefine HAVE_LIBXKBFILE 1
13
+
14
+
15
+// Defined to 1 if we have libxkbfile headers
16
+#cmakedefine HAVE_X11_EXTENSIONS_XKBRULES_H 1

+ 1
- 0
doc/CMakeLists.txt Wyświetl plik

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

+ 1
- 0
doc/en/CMakeLists.txt Wyświetl plik

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

+ 8
- 0
kkbswitch.upd/CMakeLists.txt Wyświetl plik

@@ -0,0 +1,8 @@
1
+install(
2
+   FILES
3
+       ${PROJECT_NAME}.upd
4
+       kkbswitch_update_14_icons
5
+       kkbswitch_update_14_options
6
+       
7
+   DESTINATION ${DATA_INSTALL_DIR}/tdeconf_update
8
+)

+ 71
- 0
kkbswitch/CMakeLists.txt Wyświetl plik

@@ -0,0 +1,71 @@
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
+##### kkbswitch (executable)
16
+
17
+tde_add_executable( ${PROJECT_NAME} AUTOMOC
18
+
19
+  SOURCES
20
+        boldlistboxitem.cpp
21
+        boldmenuitem.cpp
22
+        kbconfig.cpp
23
+        kbconfigdlg.cpp
24
+        kbgroup.cpp
25
+        kbpickicondlg.cpp
26
+        kbswitchapp.cpp
27
+        kbswitchintf.cpp
28
+        kbswitchtrayicon.cpp
29
+        main.cpp
30
+        pathlistboxitem.cpp
31
+        xkeyboard.cpp
32
+        windowwatcher.cpp
33
+        singlewindowwatcher.cpp
34
+        windowclasswatcher.cpp
35
+        kbswitchintf.skel
36
+  LINK
37
+     tdeio-shared
38
+     tdeui-shared
39
+     tdecore-shared
40
+     ${XKBFILE_LIBRARIES}
41
+     
42
+  DESTINATION ${BIN_INSTALL_DIR}
43
+)
44
+
45
+
46
+##### other data
47
+
48
+install(
49
+    FILES ${PROJECT_NAME}.desktop
50
+    DESTINATION ${AUTOSTART_INSTALL_DIR}
51
+)
52
+
53
+install(
54
+    FILES ${PROJECT_NAME}.desktop
55
+    DESTINATION ${APPS_INSTALL_DIR}/Utilities
56
+)
57
+
58
+install(
59
+    FILES group_names
60
+    DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
61
+)
62
+
63
+
64
+##### Russian - Ukrainian Layout
65
+
66
+if( WITH_RU_UA_LAYOUT )
67
+install(
68
+    FILES ru_ua
69
+    DESTINATION ${SHARE_INSTALL_PREFIX}/X11/xkb/symbols
70
+)
71
+endif( WITH_RU_UA_LAYOUT )

+ 2
- 0
kkbswitch/kbconfigdlg.cpp Wyświetl plik

@@ -406,3 +406,5 @@ void KBConfigDlg::checkIconDefault(int index)
406 406
     btnSetDefaultIcon->setEnabled(!conf->readEntry(m_kbconf->getGroup(index)->getName()/*KBConfig::entryForGroup(index)*/).isNull());
407 407
   }  
408 408
 }
409
+
410
+#include "kbconfigdlg.moc"

+ 2
- 0
kkbswitch/kbpickicondlg.cpp Wyświetl plik

@@ -201,3 +201,5 @@ void KBPickIconDlg::showCurrentPath(const TQString &currentPath,
201 201
 	lbIcons->ensureCurrentVisible();
202 202
   lbIcons->setHScrollBarMode(TQScrollView::Auto);  
203 203
 }
204
+
205
+#include "kbpickicondlg.moc"

+ 2
- 0
kkbswitch/kbswitchapp.cpp Wyświetl plik

@@ -377,3 +377,5 @@ void KBSwitchApp::setGroups(int group, int next_group)
377 377
   m_next_groupno = next_group;
378 378
   forceSetGroup(group);
379 379
 }
380
+
381
+#include "kbswitchapp.moc"

+ 2
- 0
kkbswitch/kbswitchintf.cpp Wyświetl plik

@@ -49,3 +49,5 @@ TQStringList KBSwitchIntf::getGroupNames()
49 49
     result.append(m_kbconf->getGroup(i)->getName());
50 50
   return result;
51 51
 }
52
+
53
+#include "kbswitchintf.moc"

+ 2
- 0
kkbswitch/kbswitchtrayicon.cpp Wyświetl plik

@@ -198,3 +198,5 @@ void KBSwitchTrayIcon::slotUpdateIcons(){
198 198
 void KBSwitchTrayIcon::slotHelp(){
199 199
   kapp->invokeHelp();
200 200
 }
201
+
202
+#include "kbswitchtrayicon.moc"

+ 2
- 0
kkbswitch/singlewindowwatcher.cpp Wyświetl plik

@@ -71,3 +71,5 @@ void SingleWindowWatcher::reset()
71 71
     addWindowToMap(active_window);
72 72
   else m_active_window = m_window_map.end();
73 73
 }
74
+
75
+#include "singlewindowwatcher.moc"

+ 1
- 0
kkbswitch/windowclasswatcher.cpp Wyświetl plik

@@ -104,3 +104,4 @@ void WindowClassWatcher::reset()
104 104
   else m_active_class = m_class_group_map.end();
105 105
 }
106 106
 
107
+#include "windowclasswatcher.moc"

+ 1
- 0
kkbswitch/windowwatcher.cpp Wyświetl plik

@@ -35,3 +35,4 @@ WindowWatcher::~WindowWatcher()
35 35
 {
36 36
 }
37 37
 
38
+#include "windowwatcher.moc"

+ 2
- 0
kkbswitch/xkeyboard.cpp Wyświetl plik

@@ -244,3 +244,5 @@ void XKeyboard::XklLogAppender(const char file[], const char function[],
244 244
   delete[] str;
245 245
 }    
246 246
 #endif
247
+
248
+#include "xkeyboard.moc"

+ 1
- 0
po/CMakeLists.txt Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz