lyx_mirror/development/cmake/modules/FindLyXGettext.cmake

82 lines
3.2 KiB
CMake
Raw Normal View History

Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
# - Slightly modified Find GNU gettext tools
# This module looks for the GNU gettext tools. This module defines the
# following values:
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
# GETTEXT_FOUND: True if gettext has been found.
#
# Additionally it provides the following macros:
# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
# This will create a target "translations" which will convert the
# given input po files into the binary output mo file. If the
# ALL option is used, the translations will also be created when
# building the default target.
set(hints HINTS "${GNUWIN32_DIR}/gettext-tools")
FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge ${hints})
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt ${hints})
FIND_PROGRAM(GETTEXT_XGETTEXT_EXECUTABLE xgettext ${hints})
FIND_PROGRAM(GETTEXT_MSGUNIQ_EXECUTABLE msguniq ${hints})
FIND_PROGRAM(GETTEXT_MSGCAT_EXECUTABLE msgcat ${hints})
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile)
SET(_gmoFiles)
# remove only the last extension e.g
# LyX2.0.pot ==> LyX2.0
# and not LyX2.0.pot ==> LyX2
# as it would be with NAME_WE
# GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
GET_FILENAME_COMPONENT(_potname ${_potFile} NAME)
if (_potname MATCHES "^\(.+\)\\.[^\\.]+$")
set(_potBasename ${CMAKE_MATCH_1})
else()
set(_potBasename ${_potname})
endif()
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
SET(_addToAll)
set(_firstArg)
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
IF(${_firstPoFile} STREQUAL "ALL")
SET(_addToAll "ALL")
else()
set(_firstArg ${_firstPoFile})
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
ENDIF(${_firstPoFile} STREQUAL "ALL")
get_locale_destination(LYX_LOCALEDIR)
FOREACH (_currentPoFile ${_firstArg} ${ARGN})
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
ADD_CUSTOM_COMMAND(
OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -c --statistics -o ${_gmoFile}.1 ${_absFile}
COMMAND ${CMAKE_COMMAND} -E rename ${_gmoFile}.1 ${_gmoFile}
DEPENDS ${_absPotFile} ${_absFile}
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
)
INSTALL(FILES ${_gmoFile} DESTINATION ${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
ENDFOREACH (_currentPoFile )
ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles})
set_target_properties(translations PROPERTIES FOLDER "i18n")
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00
ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
SET(GETTEXT_FOUND TRUE)
ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
SET(GETTEXT_FOUND FALSE)
IF (GetText_REQUIRED)
MESSAGE(FATAL_ERROR "GetText not found")
ENDIF (GetText_REQUIRED)
ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE GETTEXT_XGETTEXT_EXECUTABLE GETTEXT_MSGUNIQ_EXECUTABLE GETTEXT_MSGCAT_EXECUTABLE)
Kornel's cmake install changes: New files: Directories: development/cmake/po development/cmake/man Files: development/cmake/po/CMakeLists.txt Creates lyx.pot and *.gmo-files; Installs ${_lang} as ${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES/lyx.mo development/cmake/man/CMakeLists.txt Handling of lyx-manuals. development/cmake/modules/FindLyXGettext.cmake Original: (GNU) FindGettext.cmake Changed the installation subdirectory of .gmo-files. Previously installing into "/usr/local/share/lyx2.0" led to e.g. /usr/local/share/lyx2.0/share/locale/de/LC_MESSAGES/lyx.mo now /usr/local/share/lyx2.0/locale/de/LC_MESSAGES/lyx.mo Changes: development/cmake/Install.cmake macro lyx_install _parent_src_dir searches now through directories specified as simple regular expression. Until now we had to specify explicitly each directory for each language. Mode of the DESTINATION/lyx2lyx is now corect Installation of the .gmo files development/cmake/config.h.cmake: Changed some #cmakedefine to #define, because config_file() did not substitute the desired values in config.h. Some typos corrected (TOP_SRCDIR -> TOP_SRC_DIR) development/cmake/configCompiler.h.cmake Removed doubly defined ENABLE_NLS, HAVE_LC_MESSAGES Installation directory still hardcoded, users need to to set environment variable LYX_LOCALEDIR to get the corect translations. development/cmake/CMakeLists.txt Setting correct values to LYX_ABS_INSTALLED_DATADIR, LYX_ABS_INSTALLED_LOCALEDIR, LYX_ABS_TOP_SRCDIR. Now the lyx-executable searches on the installed places for it's data, so no need to set environment anymore. New variable: LYX_LOCALEDIR. We need it later in FindLyXGettext.cmake, because we cannot use the absolute path LYX_ABS_INSTALLED_LOCALEDIR. (We need relative path when packaging to different root-directory). Use of module FindLyXGettext.cmake: This is a modified version of (GNU) FindGettext.cmake Include the new development/cmake/po directory Include the new development/cmake/man directory development/cmake/po/CMakeLists.txt Creation of lyx.pot and apropriate .gmo files Creating lyx.pot file I had to use perl to simulate the unix "cat" command. Maybe Jose can write the corect statement in python git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27973 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-28 13:35:29 +00:00