diff options
author | Konstantin <ria.freelander@gmail.com> | 2018-01-11 00:34:12 +0300 |
---|---|---|
committer | Konstantin <ria.freelander@gmail.com> | 2018-01-11 00:34:12 +0300 |
commit | 99b58c44388a66ec5409bc1a133f2f1b51437f4e (patch) | |
tree | c4bb0965a839e17dc7efcb7b713e97ee869a4255 /cmake | |
parent | 74a7557cfe5d8dafde979be4c5b04fb5a382b2bf (diff) | |
download | musl-locales-99b58c44388a66ec5409bc1a133f2f1b51437f4e.tar.gz musl-locales-99b58c44388a66ec5409bc1a133f2f1b51437f4e.tar.bz2 musl-locales-99b58c44388a66ec5409bc1a133f2f1b51437f4e.tar.xz musl-locales-99b58c44388a66ec5409bc1a133f2f1b51437f4e.zip |
Reduce cmake bloat
Diffstat (limited to 'cmake')
-rwxr-xr-x | cmake/Translations.cmake | 93 | ||||
-rw-r--r-- | cmake/TranslationsMusl.cmake | 31 |
2 files changed, 1 insertions, 123 deletions
diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake index d6979c4..1f36bb6 100755 --- a/cmake/Translations.cmake +++ b/cmake/Translations.cmake @@ -6,9 +6,7 @@ macro (add_translations_directory NLS_PACKAGE) # be sure that all languages are present # Using all usual languages code from https://www.gnu.org/software/gettext/manual/html_node/Language-Codes.html#Language-Codes # Rare language codes should be added on-demand. - set (LANGUAGES_NEEDED en ru) - string (REPLACE ";" " " LINGUAS "${LANGUAGES_NEEDED}") - configure_file (${CMAKE_CURRENT_SOURCE_DIR}/LINGUAS.in ${CMAKE_CURRENT_BINARY_DIR}/LINGUAS) + file(STRINGS LINGUAS LANGUAGES_NEEDED) foreach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) create_po_file (${LANGUAGE_NEEDED}) endforeach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) @@ -26,31 +24,6 @@ macro (add_translations_directory NLS_PACKAGE) RENAME ${NLS_PACKAGE}.mo COMPONENT ${ARGV1}) endforeach (PO_INPUT ${PO_FILES}) - #Create *.desktop files - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/*.desktop.plugin.in) - foreach(PLUGIN_DESKTOP_IN_FILE ${SOURCE_FILES}) - get_filename_component( BASE_NAME ${PLUGIN_DESKTOP_IN_FILE} NAME ) - string(REGEX REPLACE ".desktop.plugin.in$" "" PLUGIN_FILE ${BASE_NAME}) - get_filename_component( BASE_DIRECTORY ${PLUGIN_DESKTOP_IN_FILE} PATH ) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}) - add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} --desktop --keyword=Name --keyword=Description --keyword=Help -d ${CMAKE_CURRENT_BINARY_DIR} --template ${CMAKE_SOURCE_DIR}/${PLUGIN_DESKTOP_IN_FILE} -o ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}/${PLUGIN_FILE}.plugin) - endforeach() - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/*.desktop.in) - foreach(DESKTOP_IN_FILE ${SOURCE_FILES}) - get_filename_component( BASE_NAME ${DESKTOP_IN_FILE} NAME ) - string(REGEX REPLACE ".desktop.in$" "" PLUGIN_FILE ${BASE_NAME}) - get_filename_component( BASE_DIRECTORY ${DESKTOP_IN_FILE} PATH ) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}) - add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} --desktop -d ${CMAKE_CURRENT_BINARY_DIR} --template ${CMAKE_SOURCE_DIR}/${DESKTOP_IN_FILE} -o ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}/${PLUGIN_FILE}.desktop) - endforeach() - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/*.desktop.xfce.in) - foreach(XFCE_DESKTOP_IN_FILE ${SOURCE_FILES}) - get_filename_component( BASE_NAME ${XFCE_DESKTOP_IN_FILE} NAME ) - string(REGEX REPLACE ".desktop.xfce.in$" "" PLUGIN_FILE ${BASE_NAME}) - get_filename_component( BASE_DIRECTORY ${XFCE_DESKTOP_IN_FILE} PATH ) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}) - add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} --desktop --keyword=Name --keyword=Comment --keyword=Help -d ${CMAKE_CURRENT_BINARY_DIR} --template ${CMAKE_SOURCE_DIR}/${XFCE_DESKTOP_IN_FILE} -o ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}/${PLUGIN_FILE}.desktop) - endforeach() endmacro (add_translations_directory) # Apply the right default template. @@ -120,11 +93,6 @@ macro (add_translations_catalog NLS_PACKAGE) find_program (XGETTEXT_EXECUTABLE xgettext) set(C_SOURCE "") - set(VALA_SOURCE "") - set(GLADE_SOURCE "") - set(PLUGIN_DESKTOP_SOURCE "") - set(DESKTOP_SOURCE "") - set(XML_SOURCE "") foreach(FILES_INPUT ${ARGN}) set(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}) @@ -133,36 +101,6 @@ macro (add_translations_catalog NLS_PACKAGE) foreach(C_FILE ${SOURCE_FILES}) set(C_SOURCE ${C_SOURCE} ${C_FILE}) endforeach() - - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.vala) - foreach(VALA_C_FILE ${SOURCE_FILES}) - set(VALA_SOURCE ${VALA_SOURCE} ${VALA_C_FILE}) - endforeach() - - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.ui) - foreach(GLADE_C_FILE ${SOURCE_FILES}) - set(GLADE_SOURCE ${GLADE_SOURCE} ${GLADE_C_FILE}) - endforeach() - - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.desktop.plugin.in) - foreach(PLUGIN_DESKTOP_IN_FILE ${SOURCE_FILES}) - set(PLUGIN_DESKTOP_SOURCE ${PLUGIN_DESKTOP_SOURCE} ${PLUGIN_DESKTOP_IN_FILE}) - endforeach() - - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.desktop.xfce.in) - foreach(XFCE_DESKTOP_IN_FILE ${SOURCE_FILES}) - set(XFCE_DESKTOP_SOURCE ${XFCE_DESKTOP_SOURCE} ${XFCE_DESKTOP_IN_FILE}) - endforeach() - - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.xml.in) - foreach(XML_IN_FILE ${SOURCE_FILES}) - set(XML_SOURCE ${PLUGIN_DESKTOP_SOURCE} ${XML_IN_FILE}) - endforeach() - - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.desktop.in) - foreach(DESKTOP_IN_FILE ${SOURCE_FILES}) - set(DESKTOP_SOURCE ${DESKTOP_SOURCE} ${DESKTOP_IN_FILE}) - endforeach() endforeach() set(BASE_XGETTEXT_COMMAND @@ -176,33 +114,4 @@ macro (add_translations_catalog NLS_PACKAGE) add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${C_SOURCE}) set(CONTINUE_FLAG "-j") ENDIF() - - IF(NOT "${VALA_SOURCE}" STREQUAL "") - add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LC\# ${VALA_SOURCE}) - set(CONTINUE_FLAG "-j") - ENDIF() - - IF(NOT "${GLADE_SOURCE}" STREQUAL "") - add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LGlade ${GLADE_SOURCE}) - set(CONTINUE_FLAG "-j") - ENDIF() - - IF(NOT "${PLUGIN_DESKTOP_SOURCE}" STREQUAL "") - add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -Ldesktop -kName -kDescription -kHelp ${PLUGIN_DESKTOP_SOURCE}) - set(CONTINUE_FLAG "-j") - ENDIF() - - IF(NOT "${XFCE_DESKTOP_SOURCE}" STREQUAL "") - add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -Ldesktop -kName -kComment -kHelp ${XFCE_DESKTOP_SOURCE}) - set(CONTINUE_FLAG "-j") - ENDIF() - - IF(NOT "${DESKTOP_SOURCE}" STREQUAL "") - add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -Ldesktop ${DESKTOP_SOURCE}) - set(CONTINUE_FLAG "-j") - ENDIF() - - IF(NOT "${XML_SOURCE}" STREQUAL "") - add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LGsettings ${XML_SOURCE}) - ENDIF() endmacro () diff --git a/cmake/TranslationsMusl.cmake b/cmake/TranslationsMusl.cmake index f9d57eb..987a0cb 100644 --- a/cmake/TranslationsMusl.cmake +++ b/cmake/TranslationsMusl.cmake @@ -7,9 +7,6 @@ macro (add_musl_translations_directory NLS_PACKAGE LOCPATH) # Using all usual languages code from https://www.gnu.org/software/gettext/manual/html_node/Language-Codes.html#Language-Codes # Rare language codes should be added on-demand. file(STRINGS LOCALES LANGUAGES_NEEDED) -# set (LANGUAGES_NEEDED aa ab ae af ak am an ar as ast av ay az ba be bg bh bi bm bn bo br bs ca ce ch ckb co cr cs cu cv cy da de dv dz ee el en_AU en_CA en_GB eo es et eu fa ff fi fj fo fr fr_CA fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mo mr ms mt my na nb nd ne ng nl nn nb nr nv ny oc oj om or os pa pi pl ps pt pt_BR qu rm rn ro ru rue rw sa sc sd se sg si sk sl sm sma sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zh_CN zh_HK zh_TW zu) -# string (REPLACE ";" " " LINGUAS "${LANGUAGES_NEEDED}") -# configure_file (${CMAKE_CURRENT_SOURCE_DIR}/LINGUAS.in ${CMAKE_CURRENT_BINARY_DIR}/LINGUAS) foreach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) create_po_file (${LANGUAGE_NEEDED}) endforeach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) @@ -26,31 +23,3 @@ macro (add_musl_translations_directory NLS_PACKAGE LOCPATH) ${LOCPATH}) endforeach (PO_INPUT ${PO_FILES}) endmacro (add_musl_translations_directory) - -macro (add_musl_translations_catalog NLS_PACKAGE) - add_custom_target (musl-pot COMMENT ?Building translation catalog for C library.?) - find_program (XGETTEXT_EXECUTABLE xgettext) - - set(C_SOURCE "") - - foreach(FILES_INPUT ${ARGN}) - set(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}) - - file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.c) - foreach(C_FILE ${SOURCE_FILES}) - set(C_SOURCE ${C_SOURCE} ${C_FILE}) - endforeach() - endforeach() - - set(BASE_XGETTEXT_COMMAND - ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} - -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot - --add-comments="/" --extract-all --from-code=UTF-8) - - set(CONTINUE_FLAG "") - - IF(NOT "${C_SOURCE}" STREQUAL "") - add_custom_command(TARGET musl-pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${C_SOURCE}) - set(CONTINUE_FLAG "-j") - ENDIF() -endmacro (add_musl_translations_catalog) |