Make install path configurable

This commit is contained in:
LordBlick 2015-09-18 20:58:23 +02:00
parent ec99736b92
commit dd36a0c89e
1 changed files with 17 additions and 3 deletions

View File

@ -4,6 +4,14 @@ project( kicad-i18n NONE )
find_package( Gettext REQUIRED ) find_package( Gettext REQUIRED )
if( UNIX AND NOT APPLE )
set( KICAD_I18N ${CMAKE_INSTALL_PREFIX}/share/locale
CACHE PATH "Location of KiCad i18n files." )
else()
set( KICAD_I18N ${CMAKE_INSTALL_PREFIX}/share/kicad/internat
CACHE PATH "Location of KiCad i18n files." )
endif()
set( LANG_ARRAY ca cs de es fi fr hu it ja ko nl pl pt ru sl sv zh_CN ) set( LANG_ARRAY ca cs de es fi fr hu it ja ko nl pl pt ru sl sv zh_CN )
foreach( LANG ${LANG_ARRAY} ) foreach( LANG ${LANG_ARRAY} )
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${LANG}) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${LANG})
@ -12,8 +20,14 @@ foreach( LANG ${LANG_ARRAY} )
${CMAKE_SOURCE_DIR}/${LANG}/kicad.po ${CMAKE_SOURCE_DIR}/${LANG}/kicad.po
-o ${CMAKE_BINARY_DIR}/${LANG}/kicad.mo ) -o ${CMAKE_BINARY_DIR}/${LANG}/kicad.mo )
install( FILES ${CMAKE_BINARY_DIR}/${LANG}/kicad.mo if( UNIX AND NOT APPLE )
DESTINATION share/kicad/internat/${LANG} install( FILES ${CMAKE_BINARY_DIR}/${LANG}/kicad.mo
COMPONENT resources ) DESTINATION ${KICAD_I18N}/${LANG}/LC_MESSAGES
COMPONENT resources )
else()
install( FILES ${CMAKE_BINARY_DIR}/${LANG}/kicad.mo
DESTINATION ${KICAD_I18N}/${LANG}
COMPONENT resources )
endif()
endforeach() endforeach()