summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--ConfigureChecks.cmake7
-rw-r--r--po/CMakeLists.txt17
3 files changed, 28 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ff5907d..8feed576 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@
#
#################################################
-cmake_minimum_required( VERSION 2.6 )
+cmake_minimum_required( VERSION 2.8 )
##### general package setup #####################
@@ -52,6 +52,7 @@ option( WITH_LIBGPOD "Enable iPod support from libgpod" OFF )
option( BUILD_ALL "Build all" OFF )
option( BUILD_DOC "Build doc" ${BUILD_ALL} )
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
##### configure checks ##########################
@@ -63,10 +64,9 @@ include( ConfigureChecks.cmake )
add_definitions(
-DHAVE_CONFIG_H
- ${TQT_CFLAGS_OTHER}
)
-set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include tqt.h" )
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
@@ -75,6 +75,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
add_subdirectory( amarok )
tde_conditional_add_subdirectory( BUILD_DOC doc )
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
##### write configure files #####################
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 43f66688..5c71a919 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -9,6 +9,13 @@
#
#################################################
+if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
+ find_program( MSGFMT_EXECUTABLE msgfmt )
+ if( NOT MSGFMT_EXECUTABLE )
+ tde_message_fatal( "msgfmt program is required, but was not found on your system" )
+ endif( )
+endif( )
+
check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 00000000..52b30c06
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1,17 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} amarok.po )
+
+foreach( _po ${po_files} )
+ get_filename_component( _lang ${_po} PATH )
+ tde_create_translation( FILES ${_po} LANG ${_lang} )
+endforeach( )