Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix generated documentation.
[simgrid.git] / buildtools / Cmake / GenerateDoc.cmake
index 9aba642..fd0dbcf 100644 (file)
@@ -36,20 +36,16 @@ file(GLOB_RECURSE source_doxygen
        "${PROJECT_DIRECTORY}/include/*.[chl]"
 )
 
        "${PROJECT_DIRECTORY}/include/*.[chl]"
 )
 
-ADD_CUSTOM_COMMAND(
-       OUTPUT ${PROJECT_DIRECTORY}/doc/html/generated
+ADD_CUSTOM_TARGET(APPEND_DOC
        COMMENT "Generating the SimGrid documentation..."
        DEPENDS ${DOC_SOURCES} ${DOC_FIGS} ${source_doxygen}
        COMMENT "Generating the SimGrid documentation..."
        DEPENDS ${DOC_SOURCES} ${DOC_FIGS} ${source_doxygen}
-       
        COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_DIRECTORY}/doc/html
        COMMAND ${CMAKE_COMMAND} -E make_directory   ${PROJECT_DIRECTORY}/doc/html
        COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_DIRECTORY}/doc/html
        COMMAND ${CMAKE_COMMAND} -E make_directory   ${PROJECT_DIRECTORY}/doc/html
-       COMMAND ${CMAKE_COMMAND} -E touch            ${PROJECT_DIRECTORY}/doc/html/generated
-
-       WORKING_DIRECTORY ${PROJECT_DIRECTORY}/doc/
+       COMMAND ${CMAKE_COMMAND} -E make_directory   ${PROJECT_DIRECTORY}/doc/html/generated
+       COMMAND ${CMAKE_COMMAND} -E touch   ${PROJECT_DIRECTORY}/doc/html/generated
+       WORKING_DIRECTORY ${PROJECT_DIRECTORY}/doc
 )
 
 )
 
-
-
 string(REGEX REPLACE ";.*logcategories.doc" "" LISTE_DEUX "${LISTE_DEUX}")
 
 #DOC_SOURCE=doc/*.doc, defined in DefinePackage
 string(REGEX REPLACE ";.*logcategories.doc" "" LISTE_DEUX "${LISTE_DEUX}")
 
 #DOC_SOURCE=doc/*.doc, defined in DefinePackage
@@ -64,37 +60,32 @@ set(DOC_PNGS
 )
 
 if(DOXYGEN_PATH AND FIG2DEV_PATH)
 )
 
 if(DOXYGEN_PATH AND FIG2DEV_PATH)
-       
-       ADD_CUSTOM_COMMAND(APPEND
-               OUTPUT doc/html/generated
+
+       ADD_CUSTOM_COMMAND(TARGET APPEND_DOC
                COMMAND ${FIG2DEV_PATH}/fig2dev -Lmap ${PROJECT_DIRECTORY}/doc/fig/simgrid_modules.fig |perl -pe 's/imagemap/simgrid_modules/g'| perl -pe 's/<IMG/<IMG style=border:0px/g' > ${PROJECT_DIRECTORY}/doc/simgrid_modules.map
        )
        
        foreach(file ${FIGS})
                string(REPLACE ".fig" ".png" tmp_file ${file})
                string(REPLACE "${PROJECT_DIRECTORY}/doc/fig/" "${PROJECT_DIRECTORY}/doc/html/" tmp_file ${tmp_file})
                COMMAND ${FIG2DEV_PATH}/fig2dev -Lmap ${PROJECT_DIRECTORY}/doc/fig/simgrid_modules.fig |perl -pe 's/imagemap/simgrid_modules/g'| perl -pe 's/<IMG/<IMG style=border:0px/g' > ${PROJECT_DIRECTORY}/doc/simgrid_modules.map
        )
        
        foreach(file ${FIGS})
                string(REPLACE ".fig" ".png" tmp_file ${file})
                string(REPLACE "${PROJECT_DIRECTORY}/doc/fig/" "${PROJECT_DIRECTORY}/doc/html/" tmp_file ${tmp_file})
-               ADD_CUSTOM_COMMAND(APPEND
-                       OUTPUT doc/html/generated
+               ADD_CUSTOM_COMMAND(TARGET APPEND_DOC
                        COMMAND "${FIG2DEV_PATH}/fig2dev -Lpng ${file} ${tmp_file}"
                )
        endforeach(file ${FIGS})
 
 
                        COMMAND "${FIG2DEV_PATH}/fig2dev -Lpng ${file} ${tmp_file}"
                )
        endforeach(file ${FIGS})
 
 
-       ADD_CUSTOM_COMMAND(APPEND
-               OUTPUT doc/html/generated
+       ADD_CUSTOM_COMMAND(TARGET APPEND_DOC
                COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_DIRECTORY}/doc/index-API.doc ${PROJECT_DIRECTORY}/doc/.FAQ.doc.toc ${PROJECT_DIRECTORY}/doc/.index.doc.toc ${PROJECT_DIRECTORY}/doc/.contrib.doc.toc ${PROJECT_DIRECTORY}/doc/.history.doc.toc
        )
        
 
        foreach(file ${DOC_PNGS})
                COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_DIRECTORY}/doc/index-API.doc ${PROJECT_DIRECTORY}/doc/.FAQ.doc.toc ${PROJECT_DIRECTORY}/doc/.index.doc.toc ${PROJECT_DIRECTORY}/doc/.contrib.doc.toc ${PROJECT_DIRECTORY}/doc/.history.doc.toc
        )
        
 
        foreach(file ${DOC_PNGS})
-               ADD_CUSTOM_COMMAND(APPEND
-                       OUTPUT doc/html/generated
+               ADD_CUSTOM_COMMAND(TARGET APPEND_DOC
                        COMMAND ${CMAKE_COMMAND} -E copy ${file} ${PROJECT_DIRECTORY}/doc/html/
                )
        endforeach(file ${DOC_PNGS})
 
                        COMMAND ${CMAKE_COMMAND} -E copy ${file} ${PROJECT_DIRECTORY}/doc/html/
                )
        endforeach(file ${DOC_PNGS})
 
-       ADD_CUSTOM_COMMAND(APPEND
-               OUTPUT doc/html/generated
+       ADD_CUSTOM_COMMAND(TARGET APPEND_DOC
                COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot_thn.jpg ${PROJECT_DIRECTORY}/doc/html/
                COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot.jpg     ${PROJECT_DIRECTORY}/doc/html/
                COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/doc/triva-graph_configuration.png        ${PROJECT_DIRECTORY}/doc/html/
                COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot_thn.jpg ${PROJECT_DIRECTORY}/doc/html/
                COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot.jpg     ${PROJECT_DIRECTORY}/doc/html/
                COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/doc/triva-graph_configuration.png        ${PROJECT_DIRECTORY}/doc/html/
@@ -104,7 +95,8 @@ if(DOXYGEN_PATH AND FIG2DEV_PATH)
 
        configure_file(${PROJECT_DIRECTORY}/doc/Doxyfile.in ${PROJECT_DIRECTORY}/doc/Doxyfile @ONLY)
 
 
        configure_file(${PROJECT_DIRECTORY}/doc/Doxyfile.in ${PROJECT_DIRECTORY}/doc/Doxyfile @ONLY)
 
-       ADD_CUSTOM_COMMAND(OUTPUT doc/html/generated APPEND
+       ADD_CUSTOM_COMMAND(TARGET APPEND_DOC
+               WORKING_DIRECTORY ${PROJECT_DIRECTORY}/doc/
                COMMAND ${CMAKE_COMMAND} -E echo "XX First Doxygen pass"
                COMMAND ${DOXYGEN_PATH}/doxygen ${PROJECT_DIRECTORY}/doc/Doxyfile
                COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/index_create.pl simgrid.tag index-API.doc
                COMMAND ${CMAKE_COMMAND} -E echo "XX First Doxygen pass"
                COMMAND ${DOXYGEN_PATH}/doxygen ${PROJECT_DIRECTORY}/doc/Doxyfile
                COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/index_create.pl simgrid.tag index-API.doc
@@ -138,7 +130,7 @@ if(BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH)
                DEPENDS all.bib
                COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/bibtex2html_table_count.pl < ${PROJECT_DIRECTORY}/doc/all.bib > ${PROJECT_DIRECTORY}/doc/publis_count.html
        )
                DEPENDS all.bib
                COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/bibtex2html_table_count.pl < ${PROJECT_DIRECTORY}/doc/all.bib > ${PROJECT_DIRECTORY}/doc/publis_count.html
        )
-       add_dependencies(doc/html/generated ${PROJECT_DIRECTORY}/doc/publis_count.html)
+       add_dependencies(APPEND_DOC ${PROJECT_DIRECTORY}/doc/publis_count.html)
 
        ADD_CUSTOM_COMMAND(
                OUTPUT publis_core.bib publis_extern.bib publis_intra.bib
 
        ADD_CUSTOM_COMMAND(
                OUTPUT publis_core.bib publis_extern.bib publis_intra.bib
@@ -157,7 +149,7 @@ if(BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH)
                        COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/bibtex2html_wrapper.pl ${file}
                )
 
                        COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/bibtex2html_wrapper.pl ${file}
                )
 
-               add_dependencies(doc/html/generated ${PROJECT_DIRECTORY}/doc/${file}.html)
+               add_dependencies(APPEND_DOC ${PROJECT_DIRECTORY}/doc/${file}.html)
        endforeach(file "publis_core publis_extern publis_intra")
        
 endif(BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH)
        endforeach(file "publis_core publis_extern publis_intra")
        
 endif(BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH)
@@ -167,8 +159,9 @@ endif(DOXYGEN_PATH AND FIG2DEV_PATH)
 ADD_CUSTOM_COMMAND(
        OUTPUT ${PROJECT_DIRECTORY}/doc/logcategories.doc
        DEPENDS ${source_doxygen}
 ADD_CUSTOM_COMMAND(
        OUTPUT ${PROJECT_DIRECTORY}/doc/logcategories.doc
        DEPENDS ${source_doxygen}
-
+       COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_DIRECTORY}/doc/logcategories.doc
        COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/xbt_log_extract_hierarchy.pl > ${PROJECT_DIRECTORY}/doc/logcategories.doc
        COMMAND ${PROJECT_DIRECTORY}/tools/doxygen/xbt_log_extract_hierarchy.pl > ${PROJECT_DIRECTORY}/doc/logcategories.doc
+       WORKING_DIRECTORY ${PROJECT_DIRECTORY}
 )
 
 
 )
 
 
@@ -265,5 +258,4 @@ else(compare_files)
        file(REMOVE ${PROJECT_DIRECTORY}/doc/tmp.realtoc)
 endif(compare_files)   
   
        file(REMOVE ${PROJECT_DIRECTORY}/doc/tmp.realtoc)
 endif(compare_files)   
   
-file(REMOVE ${PROJECT_DIRECTORY}/doc/tmp.curtoc)
-
+file(REMOVE ${PROJECT_DIRECTORY}/doc/tmp.curtoc)
\ No newline at end of file