Browse Source

conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/2/head
Gregory Guy 5 months ago
parent
commit
7a0f90f280
Signed by: gregory guy <g-gregory@gmx.fr> GPG Key ID: 6EFE0EF249A874C0
12 changed files with 398 additions and 13 deletions
  1. 78
    0
      CMakeLists.txt
  2. 52
    0
      ConfigureChecks.cmake
  3. 8
    0
      config.h.cmake
  4. 1
    0
      doc/CMakeLists.txt
  5. 0
    0
      doc/en/index.docbook
  6. 16
    12
      doc/fr/index.docbook
  7. 5
    0
      doc/man/CMakeLists.txt
  8. 154
    0
      doc/man/knights.1
  9. 55
    0
      knights/CMakeLists.txt
  10. 23
    0
      media/CMakeLists.txt
  11. 5
    0
      po/CMakeLists.txt
  12. 1
    1
      po/es.po

+ 78
- 0
CMakeLists.txt View File

@@ -0,0 +1,78 @@
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( knights )
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 "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
65
+set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
66
+
67
+
68
+##### directories
69
+
70
+add_subdirectory( ${PROJECT_NAME} )
71
+add_subdirectory( media )
72
+tde_conditional_add_subdirectory( BUILD_DOC doc         )
73
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) 
74
+
75
+
76
+##### write configure files
77
+
78
+configure_file( config.h.cmake config.h @ONLY )

+ 52
- 0
ConfigureChecks.cmake View File

@@ -0,0 +1,52 @@
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
+
46
+
47
+##### arts
48
+
49
+pkg_search_module( ARTS arts )
50
+if( NOT ARTS_FOUND )
51
+    message( FATAL_ERROR "\naRts is requested, but was not found on your system" )
52
+endif( )

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

doc/help_en.docbook → doc/en/index.docbook View File


doc/help_fr.docbook → doc/fr/index.docbook View File

@@ -8,24 +8,28 @@
8 8
 
9 9
 <book lang="&language;">
10 10
 	<bookinfo>
11
-		<title
12
->  </title>
11
+		<title>
12
+			The Knights Handbook
13
+		</title>
13 14
 		<authorgroup>
14
-			<author
15
->  </author>
15
+			<author>
16
+				<firstname>Troy</firstname>
17
+				<surname>Corbin Jr.</surname>
18
+				<affiliation>
19
+					<address>
20
+						<email>tcorbin@users.sf.net</email>
21
+					</address>
22
+				</affiliation>
23
+			</author>
16 24
 			<othercredit role="developer">
17
-				<firstname
18
->Troy</firstname>
19
-				<surname
20
->Corbin Jr.</surname>
25
+				<firstname>Troy</firstname>
26
+				<surname>Corbin Jr.</surname>
21 27
 				<affiliation>
22 28
 					<address>
23
-						<email
24
->tcorbin@users.sf.net</email>
29
+						<email>tcorbin@users.sf.net</email>
25 30
 					</address>
26 31
 				</affiliation>
27
-				<contrib
28
-></contrib>
32
+				<contrib>Developer</contrib>
29 33
 			</othercredit>
30 34
 		</authorgroup>
31 35
 		<!-- TRANS:ROLES_OF_TRANSLATORS -->

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

+ 154
- 0
doc/man/knights.1 View File

@@ -0,0 +1,154 @@
1
+.\" This file was generated by kdemangen.pl
2
+.TH KNIGHTS 1 "Jun 2004" "Trinity Desktop Environment" "The Knights Chess Interface"
3
+.SH NAME
4
+knights
5
+- The Knights Chess Interface
6
+.SH SYNOPSIS
7
+knights [Qt-options] [TDE-options] [options] [filename] 
8
+.SH DESCRIPTION
9
+The Knights Chess Interface
10
+.SH OPTIONS
11
+.SS
12
+.SS Arguments:
13
+.TP
14
+.B filename  
15
+A .pgn file to be loaded.
16
+.SS Options:
17
+.B -d <path>  
18
+Specify the location of your Knights data directory.
19
+.SS Generic options:
20
+.TP
21
+.B  --help  
22
+Show help about options
23
+.TP
24
+.B  --help-qt  
25
+Show Qt specific options
26
+.TP
27
+.B  --help-tde  
28
+Show TDE specific options
29
+.TP
30
+.B  --help-all  
31
+Show all options
32
+.TP
33
+.B  --author  
34
+Show author information
35
+.TP
36
+.B -v,  --version  
37
+Show version information
38
+.TP
39
+.B  --license  
40
+Show license information
41
+.TP
42
+.B  --  
43
+End of options
44
+.SS 
45
+.SS TDE options:
46
+.TP
47
+.B  --caption  <caption>
48
+Use 'caption' as name in the titlebar.
49
+.TP
50
+.B  --icon  <icon>
51
+Use 'icon' as the application icon.
52
+.TP
53
+.B  --miniicon  <icon>
54
+Use 'icon' as the icon in the titlebar.
55
+.TP
56
+.B  --config  <filename>
57
+Use alternative configuration file.
58
+.TP
59
+.B  --dcopserver  <server>
60
+Use the DCOP Server specified by 'server'.
61
+.TP
62
+.B  --nocrashhandler  
63
+Disable crash handler, to get core dumps.
64
+.TP
65
+.B  --waitforwm  
66
+Waits for a WM_NET compatible windowmanager.
67
+.TP
68
+.B  --style  <style>
69
+sets the application GUI style.
70
+.TP
71
+.B  --geometry  <geometry>
72
+sets the client geometry of the main widget.
73
+.SS 
74
+.SS Qt options:
75
+.TP
76
+.B  --display  <displayname>
77
+Use the X-server display 'displayname'.
78
+.TP
79
+.B  --session  <sessionId>
80
+Restore the application for the given 'sessionId'.
81
+.TP
82
+.B  --cmap  
83
+Causes the application to install a private color
84
+map on an 8-bit display.
85
+.TP
86
+.B  --ncols  <count>
87
+Limits the number of colors allocated in the color
88
+cube on an 8-bit display, if the application is
89
+using the QApplication::ManyColor color
90
+specification.
91
+.TP
92
+.B  --nograb  
93
+tells Qt to never grab the mouse or the keyboard.
94
+.TP
95
+.B  --dograb  
96
+running under a debugger can cause an implicit
97
+-nograb, use -dograb to override.
98
+.TP
99
+.B  --sync  
100
+switches to synchronous mode for debugging.
101
+.TP
102
+.B --fn,  --font  <fontname>
103
+defines the application font.
104
+.TP
105
+.B --bg,  --background  <color>
106
+sets the default background color and an
107
+application palette (light and dark shades are
108
+calculated).
109
+.TP
110
+.B --fg,  --foreground  <color>
111
+sets the default foreground color.
112
+.TP
113
+.B --btn,  --button  <color>
114
+sets the default button color.
115
+.TP
116
+.B  --name  <name>
117
+sets the application name.
118
+.TP
119
+.B  --title  <title>
120
+sets the application title (caption).
121
+.TP
122
+.B  --visual  TrueColor
123
+forces the application to use a TrueColor visual on
124
+an 8-bit display.
125
+.TP
126
+.B  --inputstyle  <inputstyle>
127
+sets XIM (X Input Method) input style. Possible
128
+values are onthespot, overthespot, offthespot and
129
+root.
130
+.TP
131
+.B  --im  <XIM server>
132
+set XIM server.
133
+.TP
134
+.B  --noxim  
135
+disable XIM.
136
+.TP
137
+.B  --reverse  
138
+mirrors the whole layout of widgets.
139
+.SS 
140
+
141
+.SH SEE ALSO
142
+Full user documentation is available through the TDE Help Center.  You can also enter the URL
143
+.BR help:/knights/
144
+directly into konqueror or you can run 
145
+.BR "`khelpcenter help:/knights/'"
146
+from the command-line.
147
+.br
148
+.SH AUTHORS
149
+.nf
150
+Troy Corbin Jr. <tcorbin@users.sourceforge.net>
151
+.br
152
+Alexander Wels <agpwels@adelphia.net>
153
+.br
154
+

+ 55
- 0
knights/CMakeLists.txt View File

@@ -0,0 +1,55 @@
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
+##### knights (executable)
16
+
17
+tde_add_executable( ${PROJECT_NAME} AUTOMOC
18
+
19
+  SOURCES
20
+        board_2d.cpp board_base.cpp setpagedisplay.cpp
21
+        proto_xboard.cpp dlg_selectengine.cpp thinbuttons.cpp
22
+        pgn.cpp io_engine.cpp dlg_challenge.cpp idmanager.cpp
23
+        challenge_graph.cpp dlg_login.cpp tabgrip.cpp
24
+        tabpage.cpp tab_seeklist.cpp dlg_engine.cpp
25
+        setpageaudio.cpp proto_base.cpp dlg_server.cpp
26
+        core.cpp match_param.cpp knightspixcache.cpp
27
+        dlg_settings.cpp console.cpp match.cpp
28
+        setpagegeneral.cpp splash.cpp audio.cpp
29
+        main.cpp logic.cpp list_pgn.cpp challenge_graph_view.cpp
30
+        accel.cpp dlg_selectemail.cpp challenge_rectangle.cpp
31
+        knightstextview.cpp tabmanager.cpp command.cpp
32
+        dlg_newmatch.cpp chessclock.cpp dlg_promote.cpp
33
+        resource.cpp tabbox.cpp io_internet.cpp
34
+        challenge_game.cpp knights.cpp tab_pgnview.cpp
35
+        io_base.cpp wiz_setup.cpp setpageservers.cpp
36
+        proto_uci.cpp setpageengines.cpp
37
+  LINK
38
+     tdecore-shared tdeui-shared tdeio-shared tdeprint-shared
39
+     artskde-shared artsflow_idl kmedia2_idl soundserver_idl mcop
40
+     
41
+  DESTINATION ${BIN_INSTALL_DIR}
42
+)
43
+
44
+
45
+##### other data
46
+
47
+install(
48
+    FILES pgn.desktop
49
+    DESTINATION ${MIME_INSTALL_DIR}/application
50
+)
51
+
52
+install(
53
+    FILES ${PROJECT_NAME}.desktop
54
+    DESTINATION ${APPS_INSTALL_DIR}/Games/Board
55
+)

+ 23
- 0
media/CMakeLists.txt View File

@@ -0,0 +1,23 @@
1
+tde_install_icons()
2
+
3
+install(
4
+    FILES
5
+        pgn_template.kml
6
+        default-portrait.jpg
7
+        wizard.png
8
+        splash.png
9
+        icon-general.png
10
+        default-engine-portrait.jpg
11
+        icon-display.png
12
+
13
+    DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
14
+)        
15
+
16
+install(
17
+    FILES
18
+        KBDefault.tar.gz
19
+        KSDefault.tar.gz
20
+        KCDefault.tar.gz
21
+        
22
+    DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/themes
23
+)

+ 5
- 0
po/CMakeLists.txt View File

@@ -0,0 +1,5 @@
1
+file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po )
2
+
3
+if( _srcs )
4
+  tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} )
5
+endif( )

+ 1
- 1
po/es.po View File

@@ -11,7 +11,7 @@ msgstr ""
11 11
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 12
 "Language-Team: LANGUAGE <LL@li.org>\n"
13 13
 "MIME-Version: 1.0\n"
14
-"Content-Type: text/plain; charset=CHARSET\n"
14
+"Content-Type: text/plain; charset=UTF-8\n"
15 15
 "Content-Transfer-Encoding: 8bit\n"
16 16
 
17 17
 #: accel.cpp:23

Loading…
Cancel
Save