Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Karl Pietrowski <thopiekar@googlemail.com>2016-08-14 20:30:31 +0300
committerThomas Karl Pietrowski <thopiekar@googlemail.com>2016-08-14 20:30:31 +0300
commit6d18540fa77c3422761bfb044335e003b7fcf0b7 (patch)
treea981e053baf1a78b4bc88713ebcade43d9ef8d3a /CMakeLists.txt
parent4472e0206e8d5380e3f4a85dc2c257e469c2a8bd (diff)
CURA-1696: Using Uranium's translation tools
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt41
1 files changed, 3 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40fac2ca2f..452a4d8e41 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,8 @@
project(cura)
cmake_minimum_required(VERSION 2.8.12)
+include(UraniumTranslationTools)
+
include(GNUInstallDirs)
set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY "The location of the scripts directory of the Uranium repository")
@@ -17,48 +19,11 @@ set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY)
configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
-# Macro needed to list all sub-directory of a directory.
-# There is no function in cmake as far as I know.
-# Found at: http://stackoverflow.com/a/7788165
-MACRO(SUBDIRLIST result curdir)
- FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
- SET(dirlist "")
- FOREACH(child ${children})
- IF(IS_DIRECTORY ${curdir}/${child})
- STRING(REPLACE "/" "" child ${child})
- LIST(APPEND dirlist ${child})
- ENDIF()
- ENDFOREACH()
- SET(${result} ${dirlist})
-ENDMACRO()
-
if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "")
# Extract Strings
add_custom_target(extract-messages ${URANIUM_SCRIPTS_DIR}/extract-messages ${CMAKE_SOURCE_DIR} cura)
-
# Build Translations
- find_package(Gettext)
- if(GETTEXT_FOUND)
- # translations target will convert .po files into .mo and .qm as needed.
- # The files are checked for a _qt suffix and if it is found, converted to
- # qm, otherwise they are converted to .po.
- add_custom_target(translations ALL)
- # copy-translations can be used to copy the built translation files from the
- # build directory to the source resources directory. This is mostly a convenience
- # during development, normally you want to simply use the install target to install
- # the files along side the rest of the application.
-
- SUBDIRLIST(languages ${CMAKE_SOURCE_DIR}/resources/i18n/)
- foreach(lang ${languages})
- file(GLOB po_files ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/*.po)
- foreach(po_file ${po_files})
- string(REGEX REPLACE ".*/(.*).po" "${CMAKE_BINARY_DIR}/resources/i18n/${lang}/LC_MESSAGES/\\1.mo" mo_file ${po_file})
- add_custom_command(TARGET translations POST_BUILD COMMAND mkdir ARGS -p ${CMAKE_BINARY_DIR}/resources/i18n/${lang}/LC_MESSAGES/ COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} ARGS ${po_file} -o ${mo_file} -f)
- endforeach()
- endforeach()
- install(DIRECTORY ${CMAKE_BINARY_DIR}/resources
- DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
- endif()
+ CREATE_TRANSLATION_TARGETS()
endif()
find_package(PythonInterp 3.4.0 REQUIRED)