]> sigrok.org Git - pulseview.git/blobdiff - CMakeLists.txt
Update translation
[pulseview.git] / CMakeLists.txt
index fd0d8b7e46bb05861bec3afb7c68f36e3e10629f..31164a9e77c2b8336fa7b0032d8c45227057f9b8 100644 (file)
@@ -3,6 +3,7 @@
 ##
 ## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
 ## Copyright (C) 2012-2013 Alexandru Gagniuc <mr.nuke.me@gmail.com>
+## Copyright (C) 2020 Soeren Apel <soeren@apelpie.net>
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -101,7 +102,7 @@ pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS})
 
 set(CMAKE_AUTOMOC TRUE)
 
-find_package(Qt5 5.3 COMPONENTS Core Gui Widgets Svg REQUIRED)
+find_package(Qt5 5.3 COMPONENTS Core Gui LinguistTools Widgets Svg REQUIRED)
 
 message(STATUS "Qt version: ${Qt5_VERSION}")
 
@@ -299,6 +300,7 @@ set(pulseview_SOURCES
        pv/widgets/colorpopup.cpp
        pv/widgets/devicetoolbutton.cpp
        pv/widgets/exportmenu.cpp
+       pv/widgets/flowlayout.cpp
        pv/widgets/importmenu.cpp
        pv/widgets/popup.cpp
        pv/widgets/popuptoolbutton.cpp
@@ -358,6 +360,7 @@ set(pulseview_HEADERS
        pv/widgets/colorpopup.hpp
        pv/widgets/devicetoolbutton.hpp
        pv/widgets/exportmenu.hpp
+       pv/widgets/flowlayout.hpp
        pv/widgets/importmenu.hpp
        pv/widgets/popup.hpp
        pv/widgets/popuptoolbutton.hpp
@@ -386,6 +389,8 @@ if(ENABLE_DECODE)
                pv/subwindows/decoder_selector/item.cpp
                pv/subwindows/decoder_selector/model.cpp
                pv/subwindows/decoder_selector/subwindow.cpp
+               pv/views/decoder_binary/view.cpp
+               pv/views/decoder_binary/QHexView.cpp
                pv/views/trace/decodetrace.cpp
                pv/widgets/decodergroupbox.cpp
                pv/widgets/decodermenu.cpp
@@ -394,6 +399,8 @@ if(ENABLE_DECODE)
        list(APPEND pulseview_HEADERS
                pv/data/decodesignal.hpp
                pv/subwindows/decoder_selector/subwindow.hpp
+               pv/views/decoder_binary/view.hpp
+               pv/views/decoder_binary/QHexView.hpp
                pv/views/trace/decodetrace.hpp
                pv/widgets/decodergroupbox.hpp
                pv/widgets/decodermenu.hpp
@@ -416,6 +423,21 @@ endif()
 
 qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
 
+#===============================================================================
+#= Translations
+#-------------------------------------------------------------------------------
+
+file(GLOB TS_FILES ${CMAKE_SOURCE_DIR}/l10n/*.ts)
+set_property(SOURCE ${TS_FILES} PROPERTY OUTPUT_LOCATION ${CMAKE_BINARY_DIR}/l10n)
+if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+       configure_file("translations.qrc" "translations.qrc" COPYONLY)
+endif ()
+
+qt5_add_translation(QM_FILES ${TS_FILES})
+qt5_create_translation(QM_FILES ${pulseview_SOURCES} ${TS_FILES})
+
+qt5_add_resources(pulseview_RESOURCES_RCC ${CMAKE_BINARY_DIR}/translations.qrc)
+
 #===============================================================================
 #= Global Definitions
 #-------------------------------------------------------------------------------
@@ -506,10 +528,11 @@ if(ANDROID)
        list(APPEND PULSEVIEW_LINK_LIBS "-llog")
 endif()
 
+set(INPUT_FILES_LIST ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC} ${QM_FILES})
 if(ANDROID)
-       add_library(${PROJECT_NAME} SHARED ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC})
+       add_library(${PROJECT_NAME} SHARED ${INPUT_FILES_LIST})
 else()
-       add_executable(${PROJECT_NAME} ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC})
+       add_executable(${PROJECT_NAME} ${INPUT_FILES_LIST})
 endif()
 
 target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS})