X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=i18n%2FCMakeLists.txt;h=feb774ec200ce3dd2af9ba8e5ac3b12ae37c7ce0;hp=8f9f38e98afd650895ef4d5e0506d4a57c95e896;hb=61e0633ce94a38e669382c29db498f335d2e0fa8;hpb=5cfabc7f10123e0e4f03f76ef8ecbdd6c36df511 diff --git a/i18n/CMakeLists.txt b/i18n/CMakeLists.txt index 8f9f38e9..feb774ec 100644 --- a/i18n/CMakeLists.txt +++ b/i18n/CMakeLists.txt @@ -13,31 +13,31 @@ if(QT_LRELEASE_EXECUTABLE) string(REGEX REPLACE "quassel_(.+)$" "\\1" lang ${basename}) # test if we want this set(flg 1) - if(linguas) - string(REGEX MATCH "${lang}" flg ${linguas}) - endif(linguas) + if(LINGUAS) + string(REGEX MATCH "${lang}" flg ${LINGUAS}) + endif(LINGUAS) if(flg) generate_qm(QM ${basename}) set(qm_files ${qm_files} ${QM}) set(gen_linguas "${gen_linguas} ${lang}") endif(flg) endforeach(TS_FILE ${avail_tsfiles}) - - # Write resource file - set(resfile ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc) - file(WRITE ${resfile} "\n" - "\n") - foreach(file ${qm_files}) - get_filename_component(file ${file} NAME) - file(APPEND ${resfile} " ${file}\n") - endforeach(file ${qm_files}) - file(APPEND ${resfile} "\n\n") - add_custom_command(OUTPUT ${resfile} DEPENDS ${qm_files}) - #set_directory_properties(PROPERTIES - # ADDITIONAL_MAKE_CLEAN_FILES "${outfiles} i18n.qrc") - qt4_add_resources(RC_I18N ${resfile}) - add_custom_target(i18n DEPENDS ${RC_I18N}) message(STATUS "Including languages:${gen_linguas}") else(QT_LRELEASE_EXECUTABLE) message(STATUS "WARNING: lrelease not found, you won't have translations!") endif(QT_LRELEASE_EXECUTABLE) + +# Write resource file +set(resfile ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc) +file(WRITE ${resfile} "\n" + "\n") +foreach(file ${qm_files}) + get_filename_component(file ${file} NAME) + file(APPEND ${resfile} " ${file}\n") +endforeach(file ${qm_files}) +file(APPEND ${resfile} "\n\n") + +#add_custom_command(OUTPUT ${resfile} DEPENDS ${qm_files}) +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${qm_files} i18n.qrc") +qt4_add_resources(RC_I18N ${resfile}) +add_custom_target(i18n DEPENDS ${RC_I18N})