Browse Source

[applications/amarok] added cmake support for translations

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1228680 283d02a7-25f6-0310-bc7c-ecb5cbfe19
tags/v3.5.13
samelian 8 years ago
parent
commit
65246190b6
3 changed files with 28 additions and 3 deletions
  1. 4
    3
      CMakeLists.txt
  2. 7
    0
      ConfigureChecks.cmake
  3. 17
    0
      po/CMakeLists.txt

+ 4
- 3
CMakeLists.txt View File

@@ -9,7 +9,7 @@
9 9
 #
10 10
 #################################################
11 11
 
12
-cmake_minimum_required( VERSION 2.6 )
12
+cmake_minimum_required( VERSION 2.8 )
13 13
 
14 14
 
15 15
 ##### general package setup #####################
@@ -52,6 +52,7 @@ option( WITH_LIBGPOD "Enable iPod support from libgpod" OFF )
52 52
 
53 53
 option( BUILD_ALL "Build all" OFF )
54 54
 option( BUILD_DOC "Build doc" ${BUILD_ALL} )
55
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
55 56
 
56 57
 
57 58
 ##### configure checks ##########################
@@ -63,10 +64,9 @@ include( ConfigureChecks.cmake )
63 64
 
64 65
 add_definitions(
65 66
   -DHAVE_CONFIG_H
66
-  ${TQT_CFLAGS_OTHER}
67 67
 )
68 68
 
69
-set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include tqt.h" )
69
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
70 70
 set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
71 71
 set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
72 72
 
@@ -75,6 +75,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
75 75
 
76 76
 add_subdirectory( amarok )
77 77
 tde_conditional_add_subdirectory( BUILD_DOC doc )
78
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
78 79
 
79 80
 
80 81
 ##### write configure files #####################

+ 7
- 0
ConfigureChecks.cmake View File

@@ -9,6 +9,13 @@
9 9
 #
10 10
 #################################################
11 11
 
12
+if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
13
+  find_program( MSGFMT_EXECUTABLE msgfmt )
14
+  if( NOT MSGFMT_EXECUTABLE )
15
+    tde_message_fatal( "msgfmt program is required, but was not found on your system" )
16
+  endif( )
17
+endif( )
18
+
12 19
 check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
13 20
 check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
14 21
 

+ 17
- 0
po/CMakeLists.txt View File

@@ -0,0 +1,17 @@
1
+#################################################
2
+#
3
+#  (C) 2010-2011 Serghei Amelian
4
+#  serghei (DOT) amelian (AT) gmail.com
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} amarok.po )
13
+
14
+foreach( _po ${po_files} )
15
+  get_filename_component( _lang ${_po} PATH )
16
+  tde_create_translation( FILES ${_po} LANG ${_lang} )
17
+endforeach( )

Loading…
Cancel
Save