[doc] Run sphinx against source dir, change option BUILD_DOC -> Build_Documentation

This commit is contained in:
Nils Wentzell 2018-03-13 13:23:52 +01:00
parent 73d37c6836
commit a89d558cd6
3 changed files with 20 additions and 8 deletions

View File

@ -58,10 +58,10 @@ endif()
#------------------------
# Documentation
#------------------------
option(BUILD_DOC "Build documentation" OFF)
if(${BUILD_DOC})
option(Build_Documentation "Build documentation" OFF)
if(${Build_Documentation})
if(NOT ${TRIQS_WITH_DOCUMENTATION})
message("Error: TRIQS library has not been compiled with its documentation")
endif()
add_subdirectory(doc)
endif(${BUILD_DOC})
endif()

View File

@ -1,9 +1,6 @@
# generate the conf.py
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
set(EXT_FOR_DOC "rst png txt css_t conf css js gif jpg py html bib sh")
execute_process(COMMAND cp_rs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${EXT_FOR_DOC})
# ---------------------------------
# Top Sphinx target
# ---------------------------------
@ -13,7 +10,7 @@ file(GLOB_RECURSE sources *.rst)
# create documentation target
set(sphinx_top ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
add_custom_command(OUTPUT ${sphinx_top} DEPENDS ${sources}
COMMAND ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_BINARY_DIR} html)
COMMAND ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_SOURCE_DIR} html)
add_custom_target(doc_sphinx ALL DEPENDS ${sphinx_top} ${CMAKE_CURRENT_BINARY_DIR})
# ---------------------------------

View File

@ -83,7 +83,7 @@ Finally, you will have to change the calls to :program:`python_with_DMFT` to
Version compatibility
---------------------
---------------------
Be careful that the version of the TRIQS library and of the dft tools must be
compatible (more information on the :ref:`TRIQS website <triqslibs:welcome>`.
@ -97,3 +97,18 @@ Checkout the version of the code that you want, for instance::
$ git co 1.2
Then follow the steps 2 to 5 described above to compile the code.
Custom CMake options
--------------------
Functionality of ``dft_tools`` can be tweaked using extra compile-time options passed to CMake::
cmake -DOPTION1=value1 -DOPTION2=value2 ... ../cthyb.src
+---------------------------------------------------------------+-----------------------------------------------+
| Options | Syntax |
+===============================================================+===============================================+
| Disable testing (not recommended) | -DBuild_Tests=OFF |
+---------------------------------------------------------------+-----------------------------------------------+
| Build the documentation locally | -DBuild_Documentation=ON |
+---------------------------------------------------------------+-----------------------------------------------+