From 12ad6495fa332ea499485082272f796c4b08c83c Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 11 Jan 2020 22:04:07 +0800 Subject: Bring back i18n support. Address compiler warnings in QDialSkualptureStyle. Introduced build BUILD_PORTABLE, replacing QMP_BUILD_MODE in the QMake project. The QMake project is now fully covered by the CMake project and officially deprecated. --- qmidiplayer-desktop/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qmidiplayer-desktop/CMakeLists.txt') diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt index 87741f8..ca2b6b7 100644 --- a/qmidiplayer-desktop/CMakeLists.txt +++ b/qmidiplayer-desktop/CMakeLists.txt @@ -60,6 +60,9 @@ include_directories(${PROJECT_SOURCE_DIR}/include/) cmake_host_system_information(RESULT build_host QUERY HOSTNAME) add_definitions(-DBUILD_MACHINE=${build_host}) +if(UNIX AND NOT BUILD_PORTABLE) + add_definitions(-DNON_PORTABLE -DINSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}) +endif() add_executable(qmidiplayer ${qmpdesktop_SOURCES} @@ -74,6 +77,10 @@ target_link_libraries(qmidiplayer ${CMAKE_DL_LIBS} ) +file(GLOB qmpdesktop_TS_FILES translations/*.ts) +qt5_create_translation(qmpdesktop_QM_FILES ${qmpdesktop_SOURCES} ${qmpdesktop_TS_FILES}) +add_custom_target(translations ALL DEPENDS ${qmpdesktop_QM_FILES}) + install(TARGETS qmidiplayer) install(DIRECTORY ${PROJECT_SOURCE_DIR}/doc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/qmidiplayer) @@ -84,3 +91,4 @@ install(FILES ${PROJECT_SOURCE_DIR}/img/qmidiplyr.png DESTINATION ${CMAKE_INSTAL install(FILES ${PROJECT_SOURCE_DIR}/img/qmidiplyr.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps) install(FILES menu/qmidiplayer DESTINATION ${CMAKE_INSTALL_PREFIX}/share/menu) install(FILES qmidiplayer.mime DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/packages) +install(FILES ${qmpdesktop_QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/qmidiplayer/translations) -- cgit v1.2.3