Skip to content
Snippets Groups Projects
Commit 5e8c85ff authored by Dmitry Simonenko's avatar Dmitry Simonenko
Browse files

doc-fix: added option to enable documentation build

parent cf3acd0b
No related branches found
No related tags found
No related merge requests found
......@@ -214,10 +214,11 @@ endif()
#
# Now handle all configuration options.
#
option(ENABLE_DOC "Enable building of documentation" OFF)
# LuaJIT options are defined in cmake/luajit.cmake
option(ENABLE_CLIENT "Enable building of console client" Off)
option(ENABLE_CLIENT "Enable building of console client" OFF)
if (ENABLE_CLIENT)
set (TARANTOOL_CLIENTS ${TARANTOOL_CLIENTS} "tarantool")
endif()
......@@ -332,6 +333,7 @@ message (STATUS "ENABLE_TRACE: ${ENABLE_TRACE}")
message (STATUS "ENABLE_BACKTRACE: ${ENABLE_BACKTRACE} (symbol resolve: ${HAVE_BFD})")
message (STATUS "ENABLE_CLIENT: ${ENABLE_CLIENT}")
message (STATUS "ENABLE_BUNDLED_LUAJIT: ${ENABLE_BUNDLED_LUAJIT}")
message (STATUS "ENABLE_DOC: ${ENABLE_DOC}")
message (STATUS "")
message (STATUS "To view or modify configuration results, check out CMakeCache.txt.")
message (STATUS "")
add_subdirectory(man)
add_subdirectory(user)
add_subdirectory(developer)
if (ENABLE_DOC)
add_subdirectory(user)
add_subdirectory(developer)
endif()
add_subdirectory(www-data.in EXCLUDE_FROM_ALL)
if (JING STREQUAL "JING-NOTFOUND")
message (FATAL_ERROR "jing is missing")
endif()
set(PATH_DEVGUIDE_HTML "${PROJECT_BINARY_DIR}/doc/www-data/tarantool_developer_guide.html")
set(PATH_DEVGUIDE_TXT "${PROJECT_BINARY_DIR}/doc/developer/tarantool_developer_guide.txt")
if (NOT JING STREQUAL "JING-NOTFOUND")
add_custom_target(doc-check-dev ALL
COMMAND ${JING} http://docbook.org/xml/5.0/rng/docbookxi.rng
add_custom_target(doc-check-dev ALL
COMMAND ${JING} http://docbook.org/xml/5.0/rng/docbookxi.rng
${CMAKE_SOURCE_DIR}/doc/developer/developer.xml)
endif()
add_custom_command(OUTPUT ${PATH_DEVGUIDE_HTML}
COMMAND ${XSLTPROC} --nonet
......@@ -22,15 +24,13 @@ add_custom_command(OUTPUT ${PATH_DEVGUIDE_TXT}
add_custom_target(dev-html DEPENDS ${PATH_DEVGUIDE_HTML})
add_custom_target(dev-txt DEPENDS ${PATH_DEVGUIDE_TXT})
if (NOT XSLTPROC STREQUAL "XSLTPROC-NOTFOUND" AND
NOT LYNX STREQUAL "LYNX-NOTFOUND")
add_custom_target(doc-autogen-dev ALL
DEPENDS ${PATH_DEVGUIDE_HTML} ${PATH_DEVGUIDE_TXT})
if ("${CPACK_GENERATOR}" STREQUAL "RPM")
install (FILES ${PATH_DEVGUIDE_HTML}
${PATH_DEVGUIDE_TXT} DESTINATION /usr/local/doc/tarantool)
else()
install (FILES ${PATH_DEVGUIDE_HTML}
${PATH_DEVGUIDE_TXT} DESTINATION share/doc/tarantool)
endif()
add_custom_target(doc-autogen-dev ALL
DEPENDS ${PATH_DEVGUIDE_HTML} ${PATH_DEVGUIDE_TXT})
if ("${CPACK_GENERATOR}" STREQUAL "RPM")
install (FILES ${PATH_DEVGUIDE_HTML}
${PATH_DEVGUIDE_TXT} DESTINATION /usr/local/doc/tarantool)
else()
install (FILES ${PATH_DEVGUIDE_HTML}
${PATH_DEVGUIDE_TXT} DESTINATION share/doc/tarantool)
endif()
if (XMLLINT STREQUAL "XMLLINT-NOTFOUND")
message (FATAL_ERROR "xmllint is missing")
endif()
if (XSLTPROC STREQUAL "XSLTPROC-NOTFOUND")
message (FATAL_ERROR "xsltproc is missing")
endif()
if (LYNX STREQUAL "LYNX-NOTFOUND")
message (FATAL_ERROR "lynx is missing")
endif()
set(PATH_USERGUIDE_HTML "${PROJECT_BINARY_DIR}/doc/www-data/tarantool_user_guide.html")
set(PATH_USERGUIDE_TXT "${PROJECT_BINARY_DIR}/doc/user/tarantool_user_guide.txt")
......@@ -10,11 +22,9 @@ set(PATH_USERGUIDE_TXT "${PROJECT_BINARY_DIR}/doc/user/tarantool_user_guide.txt"
# since its diagnostics output is significantly more readable:
# jing http://docbook.org/xml/5.0/rng/docbookxi.rng file.xml
#
if (NOT XMLLINT STREQUAL "XMLLINT-NOTFOUND")
add_custom_target(doc-check ALL
COMMAND ${XMLLINT} --xinclude --noout --relaxng http://docbook.org/xml/5.0/rng/docbookxi.rng
add_custom_target(doc-check ALL
COMMAND ${XMLLINT} --xinclude --noout --relaxng http://docbook.org/xml/5.0/rng/docbookxi.rng
${CMAKE_SOURCE_DIR}/doc/user/user.xml)
endif()
#
# xsltproc-based documentation generation (default)
......@@ -33,17 +43,15 @@ add_custom_command(OUTPUT ${PATH_USERGUIDE_TXT}
add_custom_target(html DEPENDS ${PATH_USERGUIDE_HTML})
add_custom_target(txt DEPENDS ${PATH_USERGUIDE_TXT})
if (NOT XSLTPROC STREQUAL "XSLTPROC-NOTFOUND" AND
NOT LYNX STREQUAL "LYNX-NOTFOUND")
add_custom_target(doc-autogen ALL
DEPENDS ${PATH_USERGUIDE_HTML} ${PATH_USERGUIDE_TXT})
if ("${CPACK_GENERATOR}" STREQUAL "RPM")
install (FILES ${PATH_USERGUIDE_HTML}
${PATH_USERGUIDE_TXT} DESTINATION /usr/local/doc/tarantool)
else()
install (FILES ${PATH_USERGUIDE_HTML}
${PATH_USERGUIDE_TXT} DESTINATION share/doc/tarantool)
endif()
add_custom_target(doc-autogen ALL
DEPENDS ${PATH_USERGUIDE_HTML} ${PATH_USERGUIDE_TXT})
if ("${CPACK_GENERATOR}" STREQUAL "RPM")
install (FILES ${PATH_USERGUIDE_HTML}
${PATH_USERGUIDE_TXT} DESTINATION /usr/local/doc/tarantool)
else()
install (FILES ${PATH_USERGUIDE_HTML}
${PATH_USERGUIDE_TXT} DESTINATION share/doc/tarantool)
endif()
add_custom_target(pdf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment