Conditionally disable generating help translations

The gnome-doc-utils dependency is problematic for gnome-continuous.
This adds a configure switch --disable-documentation that turns off
generating and installing the translated help, which is the only thing
that requires xml2po and thus gnome-doc-utils.

Closes: bgo #726585
This commit is contained in:
Charles Lindsay 2014-03-17 17:09:55 -07:00
parent 6cf3f09384
commit 6ea5612863
3 changed files with 19 additions and 7 deletions

View file

@ -28,6 +28,7 @@ option(DEBUG "Build for debugging." OFF)
option(ICON_UPDATE "Run gtk-update-icon-cache after the install." ON)
option(DESKTOP_UPDATE "Run update-desktop-database after the install." ON)
option(DESKTOP_VALIDATE "Check generated desktop file for errors during build." ON)
option(TRANSLATE_HELP "Generate and install translated help documentation." ON)
if (DEBUG)
message(STATUS "Debug build")
@ -45,6 +46,10 @@ if (DESKTOP_VALIDATE)
message(STATUS "Generated desktop file will be checked for errors")
endif ()
if (TRANSLATE_HELP)
message(STATUS "Help translations will be generated and installed")
endif ()
find_package(PkgConfig)
pkg_check_modules(LIBUNITY QUIET unity>=5.12.0)
pkg_check_modules(LIBMESSAGINGMENU QUIET messaging-menu>=12.10.2)

6
configure vendored
View file

@ -34,6 +34,8 @@ configure_help() {
Disable checking for errors in generated desktop file.
--disable-icon-update
Disable icon cache update.
--disable-documentation
Disable generating and installing translated help documentation.
Some influential environment variables:
PKG_CONFIG_PATH Adds directories to pkg-config's search path.
@ -104,6 +106,10 @@ do
--disable-desktop-validate)
CMDLINE="${CMDLINE} -DDESKTOP_VALIDATE=OFF"
;;
--disable-documentation)
CMDLINE="${CMDLINE} -DTRANSLATE_HELP=OFF"
;;
VALAC) [ ! $value ] && abort $1
VALAC=$value

View file

@ -29,12 +29,6 @@ endforeach()
install(FILES ${HELP_SOURCE} DESTINATION ${HELP_DEST}/C)
install(FILES C/figures/geary.svg DESTINATION ${HELP_DEST}/C/figures)
FIND_PROGRAM(XML2PO_BIN xml2po)
IF(NOT XML2PO_BIN)
MESSAGE(FATAL_ERROR "xml2po not found")
ENDIF()
# Hacked together from the similar macro in cmake/Gettext.cmake.
MACRO(HELP_CREATE_TRANSLATIONS _firstLang)
SET(_translatedPages)
@ -78,4 +72,11 @@ MACRO(HELP_CREATE_TRANSLATIONS _firstLang)
ENDIF()
ENDMACRO()
HELP_CREATE_TRANSLATIONS(ALL ${TRANSLATED} COMMENT "Translating help docs.")
IF(TRANSLATE_HELP)
FIND_PROGRAM(XML2PO_BIN xml2po)
IF(NOT XML2PO_BIN)
MESSAGE(FATAL_ERROR "xml2po not found")
ENDIF()
HELP_CREATE_TRANSLATIONS(ALL ${TRANSLATED} COMMENT "Translating help docs.")
ENDIF()