summaryrefslogtreecommitdiff
path: root/po
diff options
context:
space:
mode:
authorTomáš Chvátal <scarabeus@gentoo.org>2009-05-26 18:54:19 +0200
committerTomáš Chvátal <scarabeus@gentoo.org>2009-05-26 18:54:26 +0200
commit759185a9f8b2561f718d681fbecd531c75b6e49b (patch)
treee35ea48f017eb078994e50a9213b6de95365e913 /po
parent7b616b5098c437661ec438b4a66101950d457256 (diff)
First attempt to solve linguas install correctly as expected in gettext.
Diffstat (limited to 'po')
-rw-r--r--po/CMakeLists.txt18
1 files changed, 16 insertions, 2 deletions
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 6c8e7e9..e57489e 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -4,8 +4,6 @@
MESSAGE ( STATUS "<Locating Gettext>" )
FIND_PACKAGE ( Gettext REQUIRED )
INCLUDE_DIRECTORIES ( ${GETTEXT_INCLUDE_DIR} )
-FILE ( GLOB _po_files *.po )
-SET ( _gmoFiles )
###############################################################################
# CREATE .MO FOR EACH .PO
###############################################################################
@@ -15,6 +13,22 @@ SET ( _gmoFiles )
# if it is empty, dont install any language
# if it is set to some value, install those
###############################################################################
+IF ( DEFINED $ENV{LINGUAS} )
+ # no languages
+ SET ( _po_files )
+ IF ( $ENV{LINGUAS} )
+ # only specified languages
+ FOREACH ( _lang $ENV{LINGUAS} )
+ IF ( EXISTS ${CURRENT_SOURCE_DIR}/${_lang}.po )
+ LIST ( APPEND _po_files ${CURRENT_SOURCE_DIR}/${_lang}.po )
+ ENDIF ( EXISTS ${CURRENT_SOURCE_DIR}/${_lang}.po )
+ ENDFOREACH ( _lang )
+ ENDIF ( $ENV{LINGUAS} )
+ELSE ( DEFINED $ENV{LINGUAS} )
+ # all languages
+ FILE ( GLOB _po_files *.po )
+ENDIF ( DEFINED $ENV{FOO} )
+SET ( _gmoFiles )
FOREACH ( _current_PO_FILE ${_po_files} )
GET_FILENAME_COMPONENT ( _lang ${_current_PO_FILE} NAME_WE )
SET ( _gmoFile ${CMAKE_BINARY_DIR}/po/${_lang}.gmo )