doc/CMakeLists.txt
changeset 784 1a7fe3bef514
parent 679 9c7639f3a741
child 827 8131c2b9f59a
     1.1 --- a/doc/CMakeLists.txt	Fri Oct 16 10:21:37 2009 +0200
     1.2 +++ b/doc/CMakeLists.txt	Thu Nov 05 15:50:01 2009 +0100
     1.3 @@ -1,42 +1,52 @@
     1.4  SET(PACKAGE_NAME ${PROJECT_NAME})
     1.5  SET(PACKAGE_VERSION ${PROJECT_VERSION})
     1.6 -SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
     1.7 -SET(abs_top_builddir ${CMAKE_BINARY_DIR})
     1.8 +SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
     1.9 +SET(abs_top_builddir ${PROJECT_BINARY_DIR})
    1.10  
    1.11  CONFIGURE_FILE(
    1.12 -  ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
    1.13 -  ${CMAKE_BINARY_DIR}/doc/Doxyfile
    1.14 -  @ONLY)
    1.15 +  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
    1.16 +  ${PROJECT_BINARY_DIR}/doc/Doxyfile
    1.17 +  @ONLY
    1.18 +)
    1.19  
    1.20 -IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
    1.21 +IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
    1.22    FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
    1.23 +  SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
    1.24 +  ADD_CUSTOM_TARGET(html
    1.25 +    COMMAND ${CMAKE_COMMAND} -E remove_directory gen-images
    1.26 +    COMMAND ${CMAKE_COMMAND} -E make_directory gen-images
    1.27 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
    1.28 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
    1.29 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
    1.30 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
    1.31 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
    1.32 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
    1.33 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
    1.34 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
    1.35 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
    1.36 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
    1.37 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
    1.38 +    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
    1.39 +    COMMAND ${CMAKE_COMMAND} -E remove_directory html
    1.40 +    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/bib2dox.py ${CMAKE_CURRENT_SOURCE_DIR}/references.bib >references.dox
    1.41 +    COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
    1.42 +    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    1.43 +  )
    1.44 +
    1.45 +  SET_TARGET_PROPERTIES(html PROPERTIES PROJECT_LABEL BUILD_DOC)
    1.46 +
    1.47    IF(UNIX)
    1.48 -    ADD_CUSTOM_TARGET(html
    1.49 -      COMMAND rm -rf gen-images
    1.50 -      COMMAND mkdir gen-images
    1.51 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
    1.52 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
    1.53 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
    1.54 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
    1.55 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
    1.56 -      COMMAND rm -rf html
    1.57 -      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
    1.58 -      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
    1.59 +    INSTALL(
    1.60 +      DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
    1.61 +      DESTINATION share/doc/lemon/html
    1.62 +      COMPONENT html_documentation
    1.63 +    )
    1.64    ELSEIF(WIN32)
    1.65 -    ADD_CUSTOM_TARGET(html
    1.66 -      COMMAND if exist gen-images rmdir /s /q gen-images
    1.67 -      COMMAND mkdir gen-images
    1.68 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
    1.69 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
    1.70 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
    1.71 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
    1.72 -      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
    1.73 -      COMMAND if exist html rmdir /s /q html
    1.74 -      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
    1.75 -      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
    1.76 -  ENDIF(UNIX)
    1.77 -  INSTALL(
    1.78 -    DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
    1.79 -    DESTINATION share/doc
    1.80 -    COMPONENT html_documentation)
    1.81 -ENDIF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
    1.82 +    INSTALL(
    1.83 +      DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
    1.84 +      DESTINATION doc
    1.85 +      COMPONENT html_documentation
    1.86 +    )
    1.87 +  ENDIF()
    1.88 +
    1.89 +ENDIF()