X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=5330663dbf755100dfb99c42296e14a9681d8a43;hb=9a220973c4e4eaccdab85a5dc90d2ee893f8d247;hp=fbfb5eb1113213f0a2655b1b1c80a3faf291f434;hpb=c7b76823dac770da072667877622428591ac26a1;p=pulseview.git diff --git a/CMakeLists.txt b/CMakeLists.txt index fbfb5eb1..5330663d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ ## ## Copyright (C) 2012 Joel Holdsworth ## Copyright (C) 2012-2013 Alexandru Gagniuc +## Copyright (C) 2020 Soeren Apel ## ## 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 @@ -420,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 #------------------------------------------------------------------------------- @@ -510,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})