Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ensures that the native libraries are always loaded before trying to access them
[simgrid.git] / GenerateDoc.cmake
1 #### Generate the html documentation
2 find_path(DOXYGEN_PATH  NAMES doxygen   PATHS NO_DEFAULT_PATHS)
3 find_path(JAVADOC_PATH  NAMES javadoc   PATHS NO_DEFAULT_PATHS)
4
5 if(DOXYGEN_PATH AND JAVADOC_PATH)
6         
7         configure_file(${CMAKE_HOME_DIRECTORY}/doc/Doxyfile.in ${CMAKE_HOME_DIRECTORY}/doc/Doxyfile @ONLY)
8         configure_file(${CMAKE_HOME_DIRECTORY}/doc/footer.html.in ${CMAKE_HOME_DIRECTORY}/doc/footer.html @ONLY)                
9         
10         ADD_CUSTOM_TARGET(documentation
11                 COMMENT "Generating the SimGrid documentation..."
12                 COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_HOME_DIRECTORY}/doc/html
13             COMMAND ${CMAKE_COMMAND} -E make_directory   ${CMAKE_HOME_DIRECTORY}/doc/html
14                 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc
15         )
16         
17         ADD_CUSTOM_COMMAND(TARGET documentation
18             COMMAND ${CMAKE_COMMAND} -E echo "XX Doxygen pass"
19                 COMMAND ${DOXYGEN_PATH}/doxygen Doxyfile
20                 
21         COMMAND ${CMAKE_COMMAND} -E echo "XX Javadoc pass"
22         COMMAND ${JAVADOC_PATH}/javadoc -d ${CMAKE_HOME_DIRECTORY}/doc/html/javadoc/ ${CMAKE_HOME_DIRECTORY}/org/simgrid/msg/*.java
23                 
24                 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/
25         )
26         
27         ADD_CUSTOM_COMMAND(TARGET documentation
28         COMMAND ${CMAKE_COMMAND} -E echo "XX Post-processing Doxygen result"
29         COMMAND ${CMAKE_HOME_DIRECTORY}/doxygen_postprocesser.pl
30         
31         WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc
32     )
33         
34 else(DOXYGEN_PATH AND JAVADOC_PATH)
35         ADD_CUSTOM_TARGET(documentation
36                         COMMENT "Generating the SimGrid documentation..."
37                         )
38
39         ADD_CUSTOM_COMMAND(TARGET documentation
40                         COMMAND ${CMAKE_COMMAND} -E echo "DOXYGEN_PATH          = ${DOXYGEN_PATH}"
41                         COMMAND ${CMAKE_COMMAND} -E echo "JAVADOC_PATH      = ${JAVADOC_PATH}"
42                         COMMAND ${CMAKE_COMMAND} -E echo "FAIL TO MAKE SIMGRID DOCUMENTATION see previous messages for details ..."
43                         COMMAND false
44                         )       
45 endif(DOXYGEN_PATH AND JAVADOC_PATH)
46
47 ADD_CUSTOM_TARGET(pdf
48     COMMAND ${CMAKE_COMMAND} -E echo "XX First pass simgridJava_documentation.pdf"
49     COMMAND make clean
50     COMMAND make pdf || true
51     COMMAND ${CMAKE_COMMAND} -E echo "XX Second pass simgridJava_documentation.pdf"
52     COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/doc/latex/refman.pdf
53     COMMAND make pdf || true
54     COMMAND ${CMAKE_COMMAND} -E echo "XX Write SimgridJava_documentation.pdf"
55     COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_HOME_DIRECTORY}/doc/latex/refman.pdf ${CMAKE_HOME_DIRECTORY}/doc/latex/SG_Java_doc.pdf
56   
57     WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/latex/
58 )
59 add_dependencies(pdf simgrid_documentation)
60
61 add_custom_target(sync-gforge-doc
62 COMMAND chmod g+rw -R doc/
63 COMMAND chmod a+rX -R doc/
64 COMMAND ssh scm.gforge.inria.fr mkdir /home/groups/simgrid/htdocs/simgrid-java/${SIMGRID_JAVA_VERSION_MAJOR}.${SIMGRID_JAVA_VERSION_MINOR}.${SIMGRID_JAVA_VERSION_PATCH} || true 
65 COMMAND rsync --verbose --cvs-exclude --compress --delete --delete-excluded --rsh=ssh --ignore-times --recursive --links --perms --times --omit-dir-times 
66 doc/html/ scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid-java/${SIMGRID_JAVA_VERSION_MAJOR}.${SIMGRID_JAVA_VERSION_MINOR}.${SIMGRID_JAVA_VERSION_PATCH}/doc/ || true
67 WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
68 )
69 add_dependencies(sync-gforge-doc documentation)