Make documentation installable

If `make install` is run, the document is included if and only if
it has already been built. If `make install-html` is run, then the
documentation is always generated first, before installation. To
build the documentation separately from installation use `make doc`
This commit is contained in:
Roland Kaufmann 2012-12-20 23:41:58 +01:00
parent 22dee20c9f
commit 8ce114df89
2 changed files with 19 additions and 1 deletions

View File

@ -238,4 +238,22 @@ if (DOXYGEN_FOUND)
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
set (_formats html pdf)
foreach (format IN LISTS _formats)
string (TOUPPER ${format} FORMAT)
install (
DIRECTORY ${PROJECT_BINARY_DIR}/Documentation/${format}
DESTINATION share/doc/opm-core/
COMPONENT ${format}
OPTIONAL
)
# target to install just HTML documentation
add_custom_target (install-${format}
COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${format} -P cmake_install.cmake
COMMENT Installing ${FORMAT} documentation
VERBATIM
)
# since the documentation is optional, it is not automatically built
add_dependencies (install-${format} doc)
endforeach (format)
endif (DOXYGEN_FOUND)

View File

@ -1166,7 +1166,7 @@ GENERATE_LATEX = YES
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
LATEX_OUTPUT = pdf
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.