##
## 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
set(CMAKE_AUTOMOC TRUE)
-find_package(Qt5 COMPONENTS Core Gui Widgets Svg REQUIRED)
+find_package(Qt5 5.3 COMPONENTS Core Gui LinguistTools Widgets Svg REQUIRED)
+
+message(STATUS "Qt version: ${Qt5_VERSION}")
if(WIN32)
# MXE workaround: Use pkg-config to find Qt5 libs.
# https://github.com/mxe/mxe/issues/1642
# Not required (and doesn't work) on MSYS2.
if(NOT DEFINED ENV{MSYSTEM})
- pkg_check_modules(QT5ALL REQUIRED Qt5Widgets Qt5Gui Qt5Svg)
+ pkg_check_modules(QT5ALL REQUIRED Qt5Widgets>=5.3 Qt5Gui>=5.3 Qt5Svg>=5.3)
endif()
endif()
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
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
pv/subwindows/decoder_selector/item.cpp
pv/subwindows/decoder_selector/model.cpp
pv/subwindows/decoder_selector/subwindow.cpp
+ pv/views/decoder_output/view.cpp
+ pv/views/decoder_output/QHexView.cpp
pv/views/trace/decodetrace.cpp
pv/widgets/decodergroupbox.cpp
pv/widgets/decodermenu.cpp
list(APPEND pulseview_HEADERS
pv/data/decodesignal.hpp
pv/subwindows/decoder_selector/subwindow.hpp
+ pv/views/decoder_output/view.hpp
+ pv/views/decoder_output/QHexView.hpp
pv/views/trace/decodetrace.hpp
pv/widgets/decodergroupbox.hpp
pv/widgets/decodermenu.hpp
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
#-------------------------------------------------------------------------------
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})