[rkward] /: Add cmake option to specify (out-of-source) location of .po-files.

Thomas Friedrichsmeier null at kde.org
Wed Apr 11 14:40:36 UTC 2018


Git commit 169ba5d2df71bc17b8aa8991ff4c24d8c14a7d74 by Thomas Friedrichsmeier.
Committed on 11/04/2018 at 14:37.
Pushed by tfry into branch 'master'.

Add cmake option to specify (out-of-source) location of .po-files.

CCMAIL: vonreth at kde.org

M  +2    -0    INSTALL
M  +14   -10   i18n/CMakeLists.txt

https://commits.kde.org/rkward/169ba5d2df71bc17b8aa8991ff4c24d8c14a7d74

diff --git a/INSTALL b/INSTALL
index 090dc51e..b17928b9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -46,6 +46,8 @@ In some cases you may want to set the following options:
 -DUSE_BINARY_PACKAGES
 	Currently only interpreted on Mac OS: If RKWard should default to installing binary R packages (if available) use
 	-DUSE_BINARY_PACKAGE=1. Otherwise, RKWard will default to building R packages from source.
+-DTRANSLATION_SRC_CIR
+	If you have imported translation source files (.po-files) to a separate directory, you can specify this, here.
 
 Further generic options are listed on http://www.cmake.org/Wiki/CMake_Useful_Variables .
 
diff --git a/i18n/CMakeLists.txt b/i18n/CMakeLists.txt
index c8306d79..840e2c9c 100644
--- a/i18n/CMakeLists.txt
+++ b/i18n/CMakeLists.txt
@@ -40,21 +40,25 @@ IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
                  NOTE: msgfmt not found. Translations will *not* be installed
 ------")
 ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)
-	IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po/")
-		FILE(GLOB PO_FILES po/*.po)
-		RKHandlePO("${PO_FILES}")
-
-		ADD_CUSTOM_TARGET(translations ALL DEPENDS ${active_translations})
-	ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po/")
-	MESSAGE(WARNING
+	IF(NOT TRANSLATION_SRC_DIR)
+		SET(TRANSLATION_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/po/")
+	ENDIF(NOT TRANSLATION_SRC_DIR)
+	FILE(GLOB PO_FILES "${TRANSLATION_SRC_DIR}/*.po")
+	MESSAGE(STATUS "${PO_FILES}")
+	RKHandlePO("${PO_FILES}")
+	ADD_CUSTOM_TARGET(translations ALL DEPENDS ${active_translations})
+	IF(NOT PO_FILES)
+		MESSAGE(WARNING
 "------
-                 Translations are not available.
+        No translations found at ${TRANSLATION_SRC_DIR}.
 
-${CMAKE_CURRENT_SOURCE_DIR}/po/ was not found. This probably means that you are building from the development repository, and have not fetched translations. This is ok, if you want to run RKWard in English, only. Otherwise, to fetch translations, either
+${TRANSLATION_SRC_DIR} was not found. This probably means that you are building from the development repository, and have not fetched translations. This is ok, if you want to run RKWard in English, only. Otherwise, to fetch translations, either
    scripts/import_translations.py XX
 where (XX is your language code, such as \"de\"; optionally specify several codes separated by spaces). In some cases (esp., if you want to build all existing translations), it is much faster to use:
    git clone git://anongit.kde.org/scratch/tfry/rkward-po-export i18n/po
+Should you have installed translations to a non-standard directory, you can specify that using
+   cmake [...] -DTRANSLATION_SRC_DIR=/x/y/z
 ------")
-	ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po/")
+	ENDIF(NOT PO_FILES)
 ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE)
 



More information about the rkward-tracker mailing list