CMakeLists.txt   CMakeLists.txt 
skipping to change at line 26 skipping to change at line 26
# generate-pot-<DOMAIN> # generate-pot-<DOMAIN>
# update-po-<DOMAIN> # update-po-<DOMAIN>
# Same as above, but only affect the files in the corresponding # Same as above, but only affect the files in the corresponding
# po/<DOMAIN> directory. (DOMAIN is actually the base name of the POT # po/<DOMAIN> directory. (DOMAIN is actually the base name of the POT
# file in the subdirectory, but that should match the directory name # file in the subdirectory, but that should match the directory name
# anyway.) # anyway.)
ADD_CUSTOM_TARGET(translations) ADD_CUSTOM_TARGET(translations)
IF(NOT MSVC) IF(NOT MSVC)
# These packages are now used only to generate .pot and .po files # These packages are now used only to generate .pot and .po files
FIND_PACKAGE(Gettext) FIND_PACKAGE(Gettext)
FIND_PACKAGE(XGettext) FIND_PACKAGE(XGettext)
IF(${XGETTEXT_FOUND}) IF(${XGETTEXT_FOUND})
ADD_CUSTOM_TARGET(generate-pot) ADD_CUSTOM_TARGET(generate-pot)
ENDIF() ENDIF()
IF(${GETTEXT_FOUND}) IF(${GETTEXT_FOUND})
ADD_CUSTOM_TARGET(update-po) ADD_CUSTOM_TARGET(update-po)
ENDIF() ENDIF()
ENDIF() ENDIF()
FIND_PACKAGE(Qt5LinguistTools REQUIRED) FIND_PACKAGE(Qt5LinguistTools REQUIRED)
GET_TARGET_PROPERTY(lupdate_executable Qt5::lupdate IMPORTED_LOCATION) GET_TARGET_PROPERTY(lupdate_executable Qt5::lupdate IMPORTED_LOCATION)
GET_FILENAME_COMPONENT(qtbindirectory ${lupdate_executable} PATH) GET_FILENAME_COMPONENT(qtbindirectory ${lupdate_executable} PATH)
SET(lconvert_executable "${qtbindirectory}/lconvert") SET(lconvert_executable "${qtbindirectory}/lconvert")
# Creates translations directory if it doesn't exist # Creates translations directory if it doesn't exist
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/translations) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/translations)
skipping to change at line 62 skipping to change at line 62
# #
# "domain" is the translation domain, eg. "stellarium". A POT file # "domain" is the translation domain, eg. "stellarium". A POT file
# with the name ${domain}.pot must exist in the directory of the # with the name ${domain}.pot must exist in the directory of the
# CMakeLists.txt file invoking the macro. # CMakeLists.txt file invoking the macro.
# #
# This macro also creates the "translations-${domain}" and # This macro also creates the "translations-${domain}" and
# "update-po-${domain}" targets (see above for an explanation). # "update-po-${domain}" targets (see above for an explanation).
# #
MACRO(GETTEXT_CREATE_TRANSLATIONS _domain _firstLang) MACRO(GETTEXT_CREATE_TRANSLATIONS _domain _firstLang)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/translations/${_domain}) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/translations/${_domain})
SET(_gmoFiles) SET(_gmoFiles)
GET_FILENAME_COMPONENT(_absPotFile ${_domain}.pot ABSOLUTE) GET_FILENAME_COMPONENT(_absPotFile ${_domain}.pot ABSOLUTE)
IF(${GETTEXT_FOUND}) IF(${GETTEXT_FOUND})
# Update these PO files when building the "update-po-<DOMAIN>" and # Update these PO files when building the "update-po-<DOMAIN>" an
# "update-po" targets. d
ADD_CUSTOM_TARGET(update-po-${_domain}) # "update-po" targets.
ADD_DEPENDENCIES(update-po update-po-${_domain}) ADD_CUSTOM_TARGET(update-po-${_domain})
ADD_DEPENDENCIES(update-po update-po-${_domain})
# Make sure the POT file is updated before updating the PO files.
ADD_DEPENDENCIES(update-po-${_domain} generate-pot-${_domain}) # Make sure the POT file is updated before updating the PO files.
ENDIF() ADD_DEPENDENCIES(update-po-${_domain} generate-pot-${_domain})
ENDIF()
SET(_addToAll)
IF(${_firstLang} STREQUAL "DEFAULT_TARGET") SET(_addToAll)
SET(_addToAll "ALL") IF(${_firstLang} STREQUAL "DEFAULT_TARGET")
SET(_firstLang) SET(_addToAll "ALL")
ENDIF(${_firstLang} STREQUAL "DEFAULT_TARGET") SET(_firstLang)
ENDIF(${_firstLang} STREQUAL "DEFAULT_TARGET")
FOREACH (_lang ${ARGN})
GET_FILENAME_COMPONENT(_absFile ${_lang}.po ABSOLUTE) FOREACH (_lang ${ARGN})
FILE(RELATIVE_PATH _relFile ${PROJECT_SOURCE_DIR} ${_absFile}) GET_FILENAME_COMPONENT(_absFile ${_lang}.po ABSOLUTE)
SET(_gmoFile ${CMAKE_BINARY_DIR}/translations/${_domain}/${_lang}.q FILE(RELATIVE_PATH _relFile ${PROJECT_SOURCE_DIR} ${_absFile})
m) SET(_gmoFile ${CMAKE_BINARY_DIR}/translations/${_domain}/${_lang}
.qm)
# Convert a PO file into a qm file.
ADD_CUSTOM_COMMAND( # Convert a PO file into a qm file.
OUTPUT ${_gmoFile} ADD_CUSTOM_COMMAND(
COMMAND ${lconvert_executable} -i ${_absFile} -o ${_gmoFile} OUTPUT ${_gmoFile}
DEPENDS ${_absFile} COMMAND ${lconvert_executable} -i ${_absFile} -o ${_gmoFile}
) DEPENDS ${_absFile}
)
IF(${GETTEXT_MSGMERGE_EXECUTABLE})
# Update the PO file unconditionally when building t IF(${GETTEXT_MSGMERGE_EXECUTABLE})
he # Update the PO file unconditionally when building the
# "update-po-<DOMAIN>" target. Note that to see the # "update-po-<DOMAIN>" target. Note that to see the file bei
file being ng
# processed, we have to run "cmake -E echo", because # processed, we have to run "cmake -E echo", because the
the # COMMENT is not displayed by cmake...
# COMMENT is not displayed by cmake... ADD_CUSTOM_COMMAND(
ADD_CUSTOM_COMMAND( TARGET update-po-${_domain}
TARGET update-po-${_domain} POST_BUILD
POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "** Updating ${_relFil
COMMAND ${CMAKE_COMMAND} -E echo "** Updatin e}"
g ${_relFile}" COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update -m --backup=none -s
--quiet --update -m --backup=none -s ${_absFile} ${_absPotFile}
${_absFile} ${_absPotFile} VERBATIM
VERBATIM )
) ENDIF()
ENDIF()
INSTALL(FILES ${_gmoFile} DESTINATION share/${PACKAGE}/translatio
INSTALL(FILES ${_gmoFile} DESTINATION share/${PACKAGE}/translations ns/${_domain}/)
/${_domain}/) SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
ENDFOREACH (_lang)
ENDFOREACH (_lang)
# Create the .qm files when building the "translations-<DOMAIN>" and
# Create the .qm files when building the "translations-<DOMAIN>" and # "translations" targets.
# "translations" targets. ADD_CUSTOM_TARGET(translations-${_domain} ${_addToAll} DEPENDS ${_gmoF
ADD_CUSTOM_TARGET(translations-${_domain} ${_addToAll} DEPENDS ${_gmoFil iles})
es}) ADD_DEPENDENCIES(translations translations-${_domain})
ADD_DEPENDENCIES(translations translations-${_domain})
ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
ADD_SUBDIRECTORY(stellarium) ADD_SUBDIRECTORY(stellarium)
ADD_SUBDIRECTORY(stellarium-skycultures) ADD_SUBDIRECTORY(stellarium-skycultures)
 End of changes. 4 change blocks. 
74 lines changed or deleted 73 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/