set(flg 1)
if(LINGUAS)
string(REGEX MATCH "${lang}" flg ${LINGUAS})
- endif(LINGUAS)
+ endif()
if(flg)
+ generate_ts(QM ${basename})
generate_qm(QM ${basename})
list(APPEND qm_files ${QM})
list(APPEND gen_linguas ${lang})
- endif(flg)
+ endif()
endforeach(PO_FILE ${avail_pofiles})
if(gen_linguas)
list(REMOVE_DUPLICATES gen_linguas)
- endif(gen_linguas)
+ endif()
message(STATUS "Including languages: ${gen_linguas}")
-else(QT_LCONVERT_EXECUTABLE)
+else()
message(STATUS "WARNING: lconvert not found, you won't have translations!")
-endif(QT_LCONVERT_EXECUTABLE)
+endif()
-# For a static build, we need to include Qt translations if available
-if(STATIC AND QT_TRANSLATIONS_DIR)
- foreach(LANG ${gen_linguas})
- file(GLOB lang_files ${QT_TRANSLATIONS_DIR}/qt_${LANG}*.qm)
- foreach(absfile ${lang_files})
- get_filename_component(filename ${absfile} NAME)
- message(STATUS "Importing ${filename}")
- configure_file(${absfile} ${CMAKE_CURRENT_BINARY_DIR}/${filename} COPYONLY)
- list(APPEND qm_files ${CMAKE_CURRENT_BINARY_DIR}/${filename})
- endforeach(absfile ${lang_files})
- endforeach(LANG ${gen_linguas})
-endif(STATIC AND QT_TRANSLATIONS_DIR)
+# For a static or win32 build, we need to include Qt translations if available
+if(QT_TRANSLATIONS_DIR)
+ if(STATIC OR WIN32)
+ foreach(LANG ${gen_linguas})
+ file(GLOB lang_files ${QT_TRANSLATIONS_DIR}/qt_${LANG}*.qm)
+ foreach(absfile ${lang_files})
+ get_filename_component(filename ${absfile} NAME)
+ message(STATUS "Importing ${filename}")
+ configure_file(${absfile} ${CMAKE_CURRENT_BINARY_DIR}/${filename} COPYONLY)
+ list(APPEND qm_files ${CMAKE_CURRENT_BINARY_DIR}/${filename})
+ endforeach(absfile ${lang_files})
+ endforeach(LANG ${gen_linguas})
+ endif()
+endif()
# Write resource file
set(resfile ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc)
if(EMBED_DATA)
set(COMMON_RCS ${COMMON_RCS} ${resfile} PARENT_SCOPE)
-else(EMBED_DATA)
- install(FILES ${qm_files} DESTINATION ${DATA_INSTALL_DIR}/quassel/translations)
-endif(EMBED_DATA)
+else()
+ install(FILES ${qm_files} DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/translations)
+endif()
add_custom_target(po DEPENDS ${qm_files})