mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
Add a UPDATE_TRANSLATIONS options that actually updates translations!
This commit is contained in:
parent
8c072224c8
commit
e5eda9f172
2 changed files with 45 additions and 4 deletions
|
|
@ -115,6 +115,12 @@ set(cockatrice_TS
|
|||
# translations/cockatrice_zh_CN.ts
|
||||
)
|
||||
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
FILE(GLOB_RECURSE translate_cockatrice_SRCS ${CMAKE_SOURCE_DIR}/cockatrice/src/*.cpp)
|
||||
FILE(GLOB_RECURSE translate_common_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp)
|
||||
SET(translate_SRCS ${translate_cockatrice_SRCS} ${translate_common_SRCS})
|
||||
ENDIF(UPDATE_TRANSLATIONS)
|
||||
|
||||
if(WIN32)
|
||||
set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc)
|
||||
endif(WIN32)
|
||||
|
|
@ -149,7 +155,12 @@ if(Qt4_FOUND)
|
|||
|
||||
# Let cmake chew Qt4's translations and resource files
|
||||
# Note: header files are MOC-ed automatically by cmake
|
||||
QT4_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
QT4_CREATE_TRANSLATION(cockatrice_QM ${translate_SRCS} ${cockatrice_TS})
|
||||
ELSE(UPDATE_TRANSLATIONS)
|
||||
QT4_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
|
||||
ENDIF(UPDATE_TRANSLATIONS)
|
||||
|
||||
QT4_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
|
||||
endif()
|
||||
|
||||
|
|
@ -202,7 +213,12 @@ if(Qt5Widgets_FOUND)
|
|||
|
||||
# Let cmake chew Qt5's translations and resource files
|
||||
# Note: header files are MOC-ed automatically by cmake
|
||||
QT5_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
QT5_CREATE_TRANSLATION(cockatrice_QM ${translate_SRCS} ${cockatrice_TS})
|
||||
ELSE()
|
||||
QT5_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
|
||||
ENDIF()
|
||||
|
||||
QT5_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
|
||||
|
||||
# guess plugins and libraries directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue