From ca16e77d22cc7aecbd5cd83500227e81bb45de8a Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 2 Feb 2018 15:56:08 +0100 Subject: [PATCH] [cmake] Fixing CMakeLists.txt for documentation --- CMakeLists.txt | 2 +- doc/CMakeLists.txt | 34 ++++++++++++++-------------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbd1525d..fbc0b81a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ endif() #------------------------ option(BUILD_DOC "Build documentation" OFF) if(${BUILD_DOC}) - if(NOT TRIQS_WITH_DOCUMENTATION) + if(NOT ${TRIQS_WITH_DOCUMENTATION}) message("Error: TRIQS library has not been compiled with its documentation") endif() add_subdirectory(doc) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 54487abf..01597803 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,29 +1,23 @@ # generate the conf.py -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY) -# all rst files of the documentation -file(GLOB_RECURSE doc_sources *.rst) +# --------------------------------- +# Top Sphinx target +# --------------------------------- +# Sources +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 ${doc_sources} py_copy - COMMAND ${CMAKE_BINARY_DIR}/build_pytriqs ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -b html ${CMAKE_CURRENT_SOURCE_DIR} html) -add_custom_target(doc_sphinx ALL DEPENDS ${sphinx_top}) +add_custom_command(OUTPUT ${sphinx_top} DEPENDS ${sources} + COMMAND ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_BINARY_DIR} html) +add_custom_target(doc_sphinx ALL DEPENDS ${sphinx_top} ${CMAKE_CURRENT_BINARY_DIR}) -# install +# --------------------------------- +# Install +# --------------------------------- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ COMPONENT documentation DESTINATION share/doc/dft_tools - FILES_MATCHING - PATTERN "*.html" - PATTERN "*.png" - PATTERN "*.js" + FILES_MATCHING + REGEX "\\.(html|pdf|png|gif|jpg|js|xsl|css|py|txt|inv|bib)$" PATTERN "_*" - PATTERN "*.jpg" - PATTERN "*.gif" - PATTERN "*.xsl" - PATTERN "*.css" - PATTERN "*.pdf" - PATTERN "*.py" - PATTERN "*.txt" - PATTERN "*.inv" - PATTERN "*.bib" )