kicad/translation/CMakeLists.txt

25 lines
841 B
CMake
Raw Normal View History

2015-09-20 18:22:40 +00:00
if( UNIX AND KICAD_I18N_UNIX_STRICT_PATH )
2015-09-19 09:00:02 +00:00
set( KICAD_I18N_PATH ${CMAKE_INSTALL_PREFIX}/share/locale
CACHE PATH "Location of KiCad i18n files." )
else()
2015-09-19 09:17:40 +00:00
# Default Unix inconvenient locale lookup path
2015-09-19 09:00:02 +00:00
set( KICAD_I18N_PATH share/kicad/internat
CACHE PATH "Location of KiCad i18n files." )
endif()
file(STRINGS pofiles/LINGUAS LANG_ARRAY REGEX "^[^#].*")
# Add the commands to translate each language file
2015-09-18 16:53:02 +00:00
foreach( LANG ${LANG_ARRAY} )
set( OUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${LANG}/kicad.mo" )
translate_language( ${LANG} ${OUT_FILE} )
2015-09-18 16:53:02 +00:00
# Keep a list of the language files that are created to add to the target
list( APPEND LANG_FILES "${OUT_FILE}" )
endforeach()
# Add the target that executes the translation commands
add_custom_target( i18n ALL
DEPENDS ${LANG_FILES} )