summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2013-09-20 03:26:52 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-09-20 03:26:52 +0200
commite113ed917ca8d86e607c7fc70accd681cfefb0a4 (patch)
tree3a26e5528d7850bab5c7f8ba856588a8795e0659
parent06c56ee1e11121a033e9d4670c50ef2f893ba511 (diff)
downloadtdepowersave-e113ed917ca8d86e607c7fc70accd681cfefb0a4.tar.gz
tdepowersave-e113ed917ca8d86e607c7fc70accd681cfefb0a4.zip
Fix cmake support for translations
-rw-r--r--CMakeLists.txt11
-rw-r--r--ConfigureChecks.cmake8
-rw-r--r--po/CMakeLists.txt11
3 files changed, 20 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7bd0677..bd8936e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,13 @@ include( TDESetupPaths )
tde_setup_paths( )
+##### user requested modules ####################
+
+option( BUILD_ALL "Build all" OFF )
+option( BUILD_DOC "Build doc" ${BUILD_ALL} )
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
+
+
##### configure checks ##########################
include( ConfigureChecks.cmake )
@@ -54,8 +61,8 @@ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
##### source directories ########################
add_subdirectory( src )
-add_subdirectory( doc )
-add_subdirectory( po )
+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 c257983..68fca16 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -57,6 +57,14 @@ if( NOT DBUS_TQT_FOUND )
tde_message_fatal( "dbus-tqt is required, but was not found on your system" )
endif( )
+# check for msgfmt
+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( )
+
# required stuff
find_package( TQt )
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 627eb11..912e1d6 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -1,7 +1,7 @@
#################################################
#
-# (C) 2010-2011 Serghei Amelian
-# serghei (DOT) amelian (AT) gmail.com
+# (C) 2013 Golubev Alexander
+# fatzer2 (AT) gmail.com
#
# Improvements and feedback are welcome
#
@@ -9,9 +9,4 @@
#
#################################################
-# file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tdepowersave.po )
-
-foreach( _po ${po_files} )
- get_filename_component( _lang ${_po} PATH )
- tde_create_translation( FILES ${_po} LANG ${_lang} )
-endforeach( )
+tde_create_translation( LANG auto OUTPUT_NAME tdepowersave )