diff options
author | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-08-07 18:22:15 +0300 |
---|---|---|
committer | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-08-07 18:23:02 +0300 |
commit | 0962fdddf192af60c57288bea53eaae702ee417b (patch) | |
tree | d2a92d6330765e30f77f3729ddda4c978961b290 /CMakeLists.txt | |
parent | 7253531002dc49dcf5dc59afed39544b85a3349a (diff) |
Add translations to ALL target and add install directives
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 32b356daa0..a56800925b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ project(cura) cmake_minimum_required(VERSION 2.8.12) +include(GNUInstallDirs) + set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY "The location of the scripts directory of the Uranium repository") if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") @@ -10,13 +12,14 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") # Build Translations find_package(Gettext) - include(${URANIUM_SCRIPTS_DIR}/ECMPoQmTools.cmake) + find_package(Qt5LinguistTools QUIET CONFIG) + if(GETTEXT_FOUND AND Qt5LinguistTools_FOUND) + include(${URANIUM_SCRIPTS_DIR}/ECMPoQmTools.cmake) - 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) + 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 @@ -51,11 +54,12 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") foreach(file ${qm_files} ${mo_files}) add_custom_command(TARGET copy-translations POST_BUILD COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/LC_MESSAGES/ COMMAND cp ARGS ${file} ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/LC_MESSAGES/ COMMENT "Copying ${file}...") endforeach() + + install(FILES ${qm_files} ${mo_files} DESTINATION ${CMAKE_INSTALL_DATADIR}/uranium/resources/i18n/${lang}/LC_MESSAGES/) endforeach() endif() endif() -include(GNUInstallDirs) find_package(PythonInterp 3.4.0 REQUIRED) install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/cura) |