kicad/translation/CMakeLists.txt

28 lines
958 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." )
elseif( APPLE )
set( KICAD_I18N_PATH ${KICAD_DATA}/internat
CACHE PATH "Location of KiCad i18n files." )
2015-09-19 09:00:02 +00:00
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} )