diff options
author | Stiepen22 <stiepen22@gmx.de> | 2013-09-08 20:18:55 +0200 |
---|---|---|
committer | Stiepen22 <stiepen22@gmx.de> | 2013-09-08 20:18:55 +0200 |
commit | 3a08f01509bb7671d199951b8000a3a854889d64 (patch) | |
tree | 0f90f67e5979dda73a01a627201e60d5a9dd96a7 /CMakeLists.txt | |
parent | 31e5a0fe6d75e124bc772faafcef2618e16c3dbf (diff) | |
download | MultiMC-3a08f01509bb7671d199951b8000a3a854889d64.tar MultiMC-3a08f01509bb7671d199951b8000a3a854889d64.tar.gz MultiMC-3a08f01509bb7671d199951b8000a3a854889d64.tar.lz MultiMC-3a08f01509bb7671d199951b8000a3a854889d64.tar.xz MultiMC-3a08f01509bb7671d199951b8000a3a854889d64.zip |
Changed CMakeList.txt to support translations
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cbc3d842..62f878c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(MultiMC) ######## Set CMake options ######## SET(CMAKE_AUTOMOC ON) SET(CMAKE_INCLUDE_CURRENT_DIR ON) +SET(FILES_TO_TRANSLATE ) # Output all executables and shared libs in the main build folder, not in subfolders. SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) @@ -32,6 +33,7 @@ ENDIF() # Find the required Qt parts find_package(Qt5Widgets REQUIRED) find_package(Qt5Network REQUIRED) +find_package(Qt5LinguistTools REQUIRED) include_directories(${Qt5Widgets_INCLUDE_DIRS}) @@ -308,6 +310,8 @@ gui/OneSixModEditDialog.ui gui/EditNotesDialog.ui ) +set (FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${MULTIMC_SOURCES} ${MULTIMC_UIS} ${MULTIMC_HEADERS}) + ######## Windows resource files ######## IF(WIN32) @@ -479,3 +483,18 @@ ENDIF() INCLUDE(CPack) include_directories(${PROJECT_BINARY_DIR}/include) + +### translation stuff + +file (GLOB TRANSLATIONS_FILES translations/*.ts) + +option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts files (WARNING: make clean will delete the source .ts files! Danger!)") +if (UPDATE_TRANSLATIONS) + qt5_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES}) +else (UPDATE_TRANSLATIONS) + qt5_add_translation(QM_FILES ${TRANSLATIONS_FILES}) +endif (UPDATE_TRANSLATIONS) + +add_custom_target (translations_target DEPENDS ${QM_FILES}) + +install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/translations)
\ No newline at end of file |