diff ui/CMakeLists.txt @ 421:7edfc9b9b360

Add translation for trustbridge
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 16 Apr 2014 17:05:08 +0000
parents 16b6d5686835
children d08e39b913ee
line wrap: on
line diff
--- a/ui/CMakeLists.txt	Wed Apr 16 17:00:59 2014 +0000
+++ b/ui/CMakeLists.txt	Wed Apr 16 17:05:08 2014 +0000
@@ -100,13 +100,6 @@
 # TRUSTBRIDGE_SOURCES in the test subdirectory.
 set(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_SOURCES})
 qt5_add_resources(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES})
-add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
-
-target_link_libraries(trustbridge Qt5::Widgets
-   trustbridge_common
-   ${POLARSSL_LIBRARIES}
-   ${EXTRA_STATIC_LIBS}
-   ${PROFILING_LIBS})
 
 set(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_SOURCES})
 qt5_add_resources(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES})
@@ -124,9 +117,20 @@
       ${ADMINISTRATOR_L10N}
       ${ADMINISTRATOR_TRANSLATION}
       )
+
+   configure_file(l10n/trustbridge.qrc.in trustbridge.qrc)
+   qt5_add_resources(TRUSTBRIDGE_L10N ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.qrc)
+   qt5_create_translation(TRUSTBRIDGE_TRANSLATION ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
+      ${CMAKE_CURRENT_SOURCE_DIR}/l10n/trustbridge_de_DE.ts)
+   add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
+      ${TRUSTBRIDGE_L10N}
+      ${TRUSTBRIDGE_TRANSLATION}
+      )
+
 else()
-  message (STATUS "WARNING: Could not find qt linguist tools. Translation will not be included.")
-  add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
+   message (STATUS "WARNING: Could not find qt linguist tools. Translation will not be included.")
+   add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
+   add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
 endif()
 
 target_link_libraries(administrator Qt5::Widgets
@@ -135,6 +139,13 @@
    ${EXTRA_STATIC_LIBS}
    ${PROFILING_LIBS})
 
+target_link_libraries(trustbridge Qt5::Widgets
+   trustbridge_common
+   ${POLARSSL_LIBRARIES}
+   ${EXTRA_STATIC_LIBS}
+   ${PROFILING_LIBS})
+
+
 # Tests
 add_subdirectory(tests)
 

http://wald.intevation.org/projects/trustbridge/