[opengm] 06/50: add BUILD_DOCS option for building the API documentation

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun Nov 1 17:14:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository opengm.

commit c6307e4b57b7568dc155ab0351142c91f8b829b2
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Wed Oct 21 11:17:10 2015 +0100

    add BUILD_DOCS option for building the API documentation
    
    - defaults to OFF, no dependency on Doxygen required.
    - if BUILD_DOCS is ON:
      * Doxygen is required,
      * The doc target is registered to "make all",
      * The generated documentation is installed to doc/opengm.
---
 CMakeLists.txt | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d895455..23e7fb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -618,25 +618,27 @@ endforeach()
 #--------------------------------------------------------------
 # doxygen documentation
 #--------------------------------------------------------------
-find_package(Doxygen)
-if(DOXYGEN_FOUND)
-   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
-   add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating API documentation with Doxygen" VERBATIM)
+option(BUILD_DOCS "Build API documentation." OFF)
+if(BUILD_DOCS)
+  find_package(Doxygen REQUIRED)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+    ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+    @ONLY
+  )
+  add_custom_target(doc ALL
+    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating API documentation with Doxygen" VERBATIM
+  )
+  install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html"
+    DESTINATION doc/opengm
+  )
 endif()
 
 #--------------------------------------------------------------
 # install
 #--------------------------------------------------------------
 install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/opengm" DESTINATION include PATTERN ".hxx" PATTERN ".git" EXCLUDE)
-#hack to make "make install" work even if the documentation has not been installed!
-IF(IS_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html" )
-   # do nothing
-else()
-   file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html")
-endif()
-install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html"       DESTINATION doc/opengm  PATTERN ".git" EXCLUDE PATTERN ".cmake" EXCLUDE)
 
 #--------------------------------------------------------------
 # test and install opengm python

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opengm.git



More information about the debian-science-commits mailing list