From cadafe706efa6fb1cef3df5a61157a74940bfd4a Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Sat, 22 Jan 2011 12:10:46 +0000 Subject: [PATCH] cmake: add a L10N_PORTABLE option to allow installing the file in bin/Langs (no superuser right needed) The option is on by default. Note: pcsx2 does not detect yet mo file on linux. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4245 96395faa-99c1-11dd-bbfe-3dabce05a288 --- cmake/BuildParameters.cmake | 10 ++++++++++ cmake/Translation.cmake | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index a93fc98d79..77453983f8 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -5,6 +5,8 @@ # Use all internal lib: -DFORCE_INTERNAL_ALL=TRUE # Use soundtouch internal lib: -DFORCE_INTERNAL_SOUNDTOUCH=TRUE # Use zlib internal lib: -DFORCE_INTERNAL_ZLIB=TRUE +### Miscellaneous +# Select install dir of l10n : -DL10N_PORTABLE=TRUE(bin/Langs)|FALSE(FHS, /usr...) ### Add some flags to the build process # control C flags : -DUSER_CMAKE_C_FLAGS="cflags" # control C++ flags : -DUSER_CMAKE_CXX_FLAGS="cxxflags" @@ -131,3 +133,11 @@ endif(NOT DEFINED FORCE_INTERNAL_SOUNDTOUCH) if(NOT DEFINED FORCE_INTERNAL_ZLIB) set(FORCE_INTERNAL_ZLIB FALSE) endif(NOT DEFINED FORCE_INTERNAL_ZLIB) + +#------------------------------------------------------------------------------- +# Select library system vs 3rdparty +#------------------------------------------------------------------------------- +if(NOT DEFINED L10N_PORTABLE) + set(L10N_PORTABLE TRUE) + message(STATUS "Install localization file in bin/Langs by default") +endif(NOT DEFINED L10N_PORTABLE) diff --git a/cmake/Translation.cmake b/cmake/Translation.cmake index 53f8513475..cad8d34098 100644 --- a/cmake/Translation.cmake +++ b/cmake/Translation.cmake @@ -58,7 +58,11 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 _potFile _firstPoFileArg) COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile} DEPENDS ${_absPotFile} ${_absFile} ) + IF (L10N_PORTABLE) + INSTALL(FILES ${_gmoFile} DESTINATION ${PROJECT_SOURCE_DIR}/bin/Langs/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + ELSE (L10N_PORTABLE) INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + ENDIF (L10N_PORTABLE) SET(_gmoFiles ${_gmoFiles} ${_gmoFile})