tsMuxer/tsMuxerGUI/CMakeLists.txt
Daniel Kamil Kozar d9a90f44f3
Enable translation in GUI (#218)
This change brings translation support to the tsMuxeR GUI. We have a Russian translation available so far, thanks to @abakum. The last selected translation is saved in the settings file and restored at the application's next startup. The currently used language is selectable by a combo box in the lower left corner of the window.
2020-03-01 00:35:31 +01:00

43 lines
1.1 KiB
CMake

cmake_minimum_required (VERSION 3.1)
project(tsMuxerGUI)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
find_package(Qt5 COMPONENTS Widgets Multimedia LinguistTools REQUIRED)
set(lang_qrc "translations.qrc")
configure_file(${lang_qrc} ${lang_qrc} COPYONLY)
# create_translation is not used due to QTBUG-41736
qt5_add_translation(QM_FILES translations/tsmuxergui_en.ts translations/tsmuxergui_ru.ts)
set(tsmuxer_gui_sources
main.cpp
tsmuxerwindow.cpp
muxForm.cpp
tsmuxerwindow.ui
muxForm.ui
checkboxedheaderview.cpp
images.qrc
${QM_FILES}
${CMAKE_CURRENT_BINARY_DIR}/${lang_qrc}
)
add_executable(tsMuxerGUI ${tsmuxer_gui_sources})
target_link_libraries(tsMuxerGUI Qt5::Widgets Qt5::Multimedia)
if (WIN32)
target_sources(tsMuxerGUI PRIVATE icon.rc)
elseif (APPLE)
set(MACOSX_BUNDLE_ICON_FILE tsMuxerGUI.icns)
set_source_files_properties(tsMuxerGUI.icns PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
set_target_properties(tsMuxerGUI PROPERTIES MACOSX_BUNDLE TRUE)
target_sources(tsMuxerGUI PRIVATE tsMuxerGUI.icns)
endif()