X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=po%2FCMakeLists.txt;h=1d95aa6206d9df028178609962040b661fa7ded1;hb=d271c469e6d61005e45d22e7766f0bcb431c8327;hp=0616948e6edfce28e54e85ccc68992fa82f4bf23;hpb=d68e9d67200abc51123b357bcdbbc816d4a70791;p=quassel.git diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 0616948e..1d95aa62 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -1,7 +1,7 @@ # Generate and add translations # The LINGUAS variable can be used to limit that set -if(QT_LCONVERT_EXECUTABLE) +if (TARGET Qt5::lconvert) # get environment variable for translations set(LINGUAS "$ENV{LINGUAS}") string(REGEX REPLACE "[ \t]+" \; output "${LINGUAS}") @@ -17,25 +17,25 @@ if(QT_LCONVERT_EXECUTABLE) 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 or win32 build, we need to include Qt translations if available +# For a Win32 build, we need to include Qt translations if available if(QT_TRANSLATIONS_DIR) - if(STATIC OR WIN32) + if(WIN32) foreach(LANG ${gen_linguas}) file(GLOB lang_files ${QT_TRANSLATIONS_DIR}/qt_${LANG}*.qm) foreach(absfile ${lang_files}) @@ -45,8 +45,8 @@ if(QT_TRANSLATIONS_DIR) list(APPEND qm_files ${CMAKE_CURRENT_BINARY_DIR}/${filename}) endforeach(absfile ${lang_files}) endforeach(LANG ${gen_linguas}) - endif(STATIC OR WIN32) -endif(QT_TRANSLATIONS_DIR) + endif() +endif() # Write resource file set(resfile ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc) @@ -63,10 +63,8 @@ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${qm_files};i18 if(EMBED_DATA) set(COMMON_RCS ${COMMON_RCS} ${resfile} PARENT_SCOPE) -else(EMBED_DATA) +else() install(FILES ${qm_files} DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/translations) -endif(EMBED_DATA) +endif() add_custom_target(po DEPENDS ${qm_files}) - -