Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make simgrid doc with new logo name
[simgrid.git] / buildtools / Cmake / GenerateDoc.cmake
1 #### Generate the html documentation
2
3 if(BIBTEX2HTML)
4         set(BIBTEX2HTML_PATH ${BIBTEX2HTML})
5 else(BIBTEX2HTML)
6         find_path(BIBTEX2HTML_PATH      NAMES bibtex2html       PATHS NO_DEFAULT_PATHS)
7 endif(BIBTEX2HTML)
8
9 find_path(FIG2DEV_PATH  NAMES fig2dev   PATHS NO_DEFAULT_PATHS)
10 find_path(DOXYGEN_PATH  NAMES doxygen   PATHS NO_DEFAULT_PATHS)
11
12 ### Check whether the bibtex2html that we found is the one that Arnaud requires
13 exec_program("${BIBTEX2HTML_PATH}/bibtex2html -version" OUTPUT_VARIABLE OUTPUT_BIBTEX2HTML_VERSION)
14 STRING(REPLACE "[-bibtex]" "" OUTPUT_BIBTEX2HTML_VERSION_2 ${OUTPUT_BIBTEX2HTML_VERSION})
15
16 file(GLOB_RECURSE source_doxygen
17         "${CMAKE_HOME_DIRECTORY}/tools/gras/*.[chl]"
18         "${CMAKE_HOME_DIRECTORY}/src/*.[chl]"
19         "${CMAKE_HOME_DIRECTORY}/include/*.[chl]"
20 )
21
22 if(${OUTPUT_BIBTEX2HTML_VERSION_2} STREQUAL ${OUTPUT_BIBTEX2HTML_VERSION}) # wrong version
23         SET(GOOD_BIBTEX2HTML_VERSION 0)
24 else(${OUTPUT_BIBTEX2HTML_VERSION_2} STREQUAL ${OUTPUT_BIBTEX2HTML_VERSION}) # good version
25         SET(GOOD_BIBTEX2HTML_VERSION 1)
26 endif(${OUTPUT_BIBTEX2HTML_VERSION_2} STREQUAL ${OUTPUT_BIBTEX2HTML_VERSION})
27
28 if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTEX2HTML_PATH AND GOOD_BIBTEX2HTML_VERSION)
29
30         #DOC_SOURCE=doc/*.doc, defined in DefinePackage
31         set(DOCSSOURCES "${source_doxygen}\n${DOC_SOURCE}")
32         string(REPLACE "\n" ";" DOCSSOURCES ${DOCSSOURCES})
33
34
35         set(DOC_PNGS 
36                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid_logo_2011.png
37                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid_logo_small.png
38                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/poster_thumbnail.png
39                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_01.png
40                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_02.png
41                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_03.png
42                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_04.png
43                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_05.png
44                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_06.png
45                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_001.png
46                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_002.png
47                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_003.png
48                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_004.png
49                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_005.png
50                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_006.png
51                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_007.png
52                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_008.png
53                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_009.png
54                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_010.png
55                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_011.png
56                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_012.png
57                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_013.png
58                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_014.png
59                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_015.png
60                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_016.png
61                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_017.png
62                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_018.png
63                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_019.png
64                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_020.png
65                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_021.png
66                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_022.png
67                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_023.png
68                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_024.png
69                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_025.png
70                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_026.png
71                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_027.png
72                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_028.png
73                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_029.png
74                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101_030.png
75                 ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid-101.pdf
76         )
77         
78         configure_file(${CMAKE_HOME_DIRECTORY}/doc/Doxyfile.in ${CMAKE_HOME_DIRECTORY}/doc/Doxyfile @ONLY)
79         configure_file(${CMAKE_HOME_DIRECTORY}/doc/footer.html.in ${CMAKE_HOME_DIRECTORY}/doc/footer.html @ONLY)                
80         
81         ADD_CUSTOM_TARGET(simgrid_documentation
82                 COMMENT "Generating the SimGrid documentation..."
83                 DEPENDS ${DOC_SOURCES} ${DOC_FIGS} ${source_doxygen}
84                 COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_HOME_DIRECTORY}/doc/html
85             COMMAND ${CMAKE_COMMAND} -E make_directory   ${CMAKE_HOME_DIRECTORY}/doc/html
86                 COMMAND ${FIG2DEV_PATH}/fig2dev -Lmap ${CMAKE_HOME_DIRECTORY}/doc/fig/simgrid_modules.fig | perl -pe 's/imagemap/simgrid_modules/g'| perl -pe 's/<IMG/<IMG style=border:0px/g' | ${CMAKE_HOME_DIRECTORY}/tools/doxygen/fig2dev_postprocessor.pl > ${CMAKE_HOME_DIRECTORY}/doc/simgrid_modules.map
87                 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc
88         )
89                 
90         ADD_CUSTOM_COMMAND(
91                 OUTPUT ${CMAKE_HOME_DIRECTORY}/doc/logcategories.doc
92                 DEPENDS ${source_doxygen}
93                 COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_HOME_DIRECTORY}/doc/logcategories.doc
94                 COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/xbt_log_extract_hierarchy.pl > ${CMAKE_HOME_DIRECTORY}/doc/logcategories.doc
95                 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
96         )
97
98         foreach(file ${DOC_FIGS})
99                 string(REPLACE ".fig" ".png" tmp_file ${file})
100                 string(REPLACE "${CMAKE_HOME_DIRECTORY}/doc/fig/" "${CMAKE_HOME_DIRECTORY}/doc/html/" tmp_file ${tmp_file})
101                 ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
102                         COMMAND ${FIG2DEV_PATH}/fig2dev -Lpng -S 4 ${file} ${tmp_file}
103                 )
104         endforeach(file ${DOC_FIGS})
105         
106         foreach(file ${DOC_PNGS})
107                 ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
108                         COMMAND ${CMAKE_COMMAND} -E copy ${file} ${CMAKE_HOME_DIRECTORY}/doc/html/
109                 )
110         endforeach(file ${DOC_PNGS})
111
112         ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
113                 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot_thn.jpg ${CMAKE_HOME_DIRECTORY}/doc/html/
114                 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot.jpg     ${CMAKE_HOME_DIRECTORY}/doc/html/
115                 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/doc/triva-graph_configuration.png        ${CMAKE_HOME_DIRECTORY}/doc/html/
116                 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/doc/triva-graph_visualization.png        ${CMAKE_HOME_DIRECTORY}/doc/html/
117                 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/doc/AS_hierarchy.png        ${CMAKE_HOME_DIRECTORY}/doc/html/          
118                 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/doc/simgrid.css                          ${CMAKE_HOME_DIRECTORY}/doc/html/
119         )
120         
121         ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
122             COMMAND ${CMAKE_COMMAND} -E echo "XX First Doxygen pass"
123                 COMMAND ${DOXYGEN_PATH}/doxygen Doxyfile
124                 COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/index_create.pl simgrid.tag index-API.doc
125                 COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/toc_create.pl pls.doc index.doc FAQ.doc gtut-introduction.doc install.doc bindings.doc options.doc tracing.doc platform.doc
126                 
127                 COMMAND ${CMAKE_COMMAND} -E echo "XX Second Doxygen pass"
128                 COMMAND ${DOXYGEN_PATH}/doxygen Doxyfile
129                 
130                 COMMAND ${CMAKE_COMMAND} -E echo "XX Post-processing Doxygen result"
131                 COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/doc/html/dir*
132                 COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/doxygen_postprocesser.pl
133                 
134                 COMMAND ${CMAKE_COMMAND} -E echo "XX Create shortcuts pages"
135                 COMMAND ${CMAKE_COMMAND} -E echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>\" > ${CMAKE_HOME_DIRECTORY}/doc/html/gras.html
136                 COMMAND ${CMAKE_COMMAND} -E echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>Grid Reality And Simulation.</a></h2></center></html>\" >> ${CMAKE_HOME_DIRECTORY}/doc/html/gras.html
137                 
138                 COMMAND ${CMAKE_COMMAND} -E echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__AMOK__API.html'>\" > ${CMAKE_HOME_DIRECTORY}/doc/html/amok.html
139                 COMMAND ${CMAKE_COMMAND} -E echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__AMOK__API.html'>Advanced Metacomputing Overlay Kit.</a></h2></center></html>\" >> ${CMAKE_HOME_DIRECTORY}/doc/html/amok.html
140         
141                 COMMAND ${CMAKE_COMMAND} -E echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__MSG__API.html'>\" > ${CMAKE_HOME_DIRECTORY}/doc/html/msg.html
142                 COMMAND ${CMAKE_COMMAND} -E echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__MSG__API.html'>Meta SimGrid.</a></h2></center></html>\" >> ${CMAKE_HOME_DIRECTORY}/doc/html/msg.html
143         
144                 COMMAND ${CMAKE_COMMAND} -E echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__SD__API.html'>\" > ${CMAKE_HOME_DIRECTORY}/doc/html/simdag.html
145                 COMMAND ${CMAKE_COMMAND} -E echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__SD__API.html'>DAG Simulator.</a></h2></center></html>\" >> ${CMAKE_HOME_DIRECTORY}/doc/html/simdag.html
146                 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/
147         )
148         
149 else(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTEX2HTML_PATH AND GOOD_BIBTEX2HTML_VERSION)
150
151         ADD_CUSTOM_TARGET(simgrid_documentation
152                         COMMENT "Generating the SimGrid documentation..."
153                         )
154
155         if(NOT GOOD_BIBTEX2HTML_VERSION) # wrong version
156                 ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
157                         COMMAND ${CMAKE_COMMAND} -E echo "This is not the good bibtex2html program !!!"
158                         COMMAND ${CMAKE_COMMAND} -E echo  "You can download it from:"
159                         COMMAND ${CMAKE_COMMAND} -E echo  "  ftp://ftp-sop.inria.fr/epidaure/Softs/bibtex2html/bibtex2html-1.02.tar.gz"
160                         COMMAND ${CMAKE_COMMAND} -E echo  "There is also an unofficial Debian/Ubuntu package, see:"
161                         COMMAND ${CMAKE_COMMAND} -E echo  "  http://www.loria.fr/~lnussbau/bibtex2html/README"
162                         )
163         endif(NOT GOOD_BIBTEX2HTML_VERSION)
164
165         ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
166                         COMMAND ${CMAKE_COMMAND} -E echo "DOXYGEN_PATH          = ${DOXYGEN_PATH}"
167                         COMMAND ${CMAKE_COMMAND} -E echo "FIG2DEV_PATH          = ${FIG2DEV_PATH}"
168                         COMMAND ${CMAKE_COMMAND} -E echo "BIBTEX2HTML_PATH      = ${BIBTEX2HTML_PATH}"
169                         COMMAND ${CMAKE_COMMAND} -E echo "IN ORDER TO GENERATE THE DOCUMENTATION YOU NEED ALL TOOLS !!!"
170                         COMMAND ${CMAKE_COMMAND} -E echo "FAIL TO MAKE SIMGRID DOCUMENTATION see previous messages for details ..."
171                         COMMAND false
172                         )
173
174                 
175 endif(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTEX2HTML_PATH AND GOOD_BIBTEX2HTML_VERSION)
176
177 ##############################################################################"
178
179 message(STATUS "Check individual TOCs")
180 set(LISTE_GTUT
181         doc/gtut-tour-00-install.doc
182         doc/gtut-tour-01-bones.doc
183         doc/gtut-tour-02-simple.doc
184         doc/gtut-tour-03-args.doc
185         doc/gtut-tour-04-callback.doc
186         doc/gtut-tour-05-globals.doc
187         doc/gtut-tour-06-logs.doc
188         doc/gtut-tour-07-timers.doc
189         doc/gtut-tour-08-exceptions.doc
190         doc/gtut-tour-09-simpledata.doc
191         doc/gtut-tour-10-rpc.doc
192         doc/gtut-tour-11-explicitwait.doc
193         doc/gtut-tour-recap-messages.doc
194         doc/gtut-tour-12-staticstruct.doc
195         doc/gtut-tour-13-pointers.doc
196         doc/gtut-tour-14-dynar.doc
197         doc/gtut-tour-15-manualdatadef.doc
198         doc/gtut-tour-16-exchangecb.doc
199 )
200
201 foreach(file_name ${LISTE_GTUT})
202         file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc)
203         file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc)
204         
205         file(READ "${file_name}" file_content)
206         string(REGEX MATCH "Table of Contents.*<hr>" valeur_line "${file_content}")
207         string(REPLACE "\n" ";" valeur_line "${valeur_line}")
208         string(REPLACE "\n" ";" file_content "${file_content}")
209                
210         file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc "\n") # make sure it exists
211         foreach(line ${file_content})
212                 string(REGEX MATCH "[\\]s?u?b?s?u?b?section.*" line2 "${line}")
213                 string(REGEX MATCH ".*_toc.*" line3 "${line}")
214                 if(line2 AND NOT line3)
215                         string(REPLACE "\\section " "" line2 ${line2})
216                         string(REPLACE "\\subsection " "subsection" line2 ${line2})
217                         string(REPLACE "\\subsubsection " "subsubsection" line2 ${line2})
218                         string(REGEX REPLACE " .*" "" line2 ${line2})
219                         set(line2                               " - \\ref ${line2}")
220                         string(REPLACE " - \\ref subsection"    "   - \\ref " line2 ${line2})
221                         string(REPLACE " - \\ref subsubsection" "     - \\ref " line2 ${line2})
222                         file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc "${line2}\n")
223                 endif(line2 AND NOT line3)
224         endforeach(line ${file_content})
225         
226         file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc "\n") # make sure it exists
227         foreach(line ${valeur_line})
228                 string(REGEX MATCH ".*ref.*" line_ok ${line})
229                 if(line_ok)
230                         file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc "${line_ok}\n")
231                 endif(line_ok)
232         endforeach(line ${valeur_line})
233         
234         exec_program("${CMAKE_COMMAND} -E compare_files ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc" OUTPUT_VARIABLE compare_files)
235         if(compare_files)
236                 message(STATUS "Wrong toc for ${file_name}. Should be:")
237                 file(READ "${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc" file_content)
238                 message("${file_content}")
239                 exec_program("diff -u ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc")
240         endif(compare_files)
241 endforeach(file_name ${LISTE_GTUT})
242
243 file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc)
244 file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc)
245
246 message(STATUS "Check main TOC")
247
248 foreach(file_name ${LISTE_GTUT})
249         file(READ "${file_name}" file_content)  
250         string(REGEX MATCH "Table of Contents.*<hr>" valeur_line "${file_content}")
251         string(REPLACE "\n" ";" valeur_line "${valeur_line}")
252         string(REPLACE "\n" ";" file_content "${file_content}")
253         
254         foreach(line ${file_content})
255                 string(REGEX MATCH ".*@page.*" line2 "${line}")
256                 if(line2)
257                         string(REPLACE "@page " "" line2 "${line2}")
258                         string(REGEX REPLACE " .*" "" line2 "${line2}")
259                         set(line2 " - \\ref ${line2}")
260                         file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc "${line2}\n")
261                 endif(line2)
262         endforeach(line ${file_content})
263         
264         foreach(line ${valeur_line})
265                 string(REGEX MATCH ".*toc.*" line1 "${line}")
266                 string(REGEX MATCH ".*<hr>.*" line2 "${line}")
267                 string(REGEX MATCH "^[ ]*$" line3 "${line}")
268                 string(REGEX MATCH "Table of Contents" line4 "${line}")
269                 if(NOT line1 AND NOT line2 AND NOT line3 AND NOT line4)
270                         file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc "   ${line}\n")
271                 endif(NOT line1 AND NOT line2 AND NOT line3 AND NOT line4)
272         endforeach(line ${valeur_line})
273 endforeach(file_name ${LISTE_GTUT})     
274
275 file(READ "${CMAKE_HOME_DIRECTORY}/doc/gtut-tour.doc" file_content)
276 string(REPLACE "\n" ";" file_content "${file_content}")
277 foreach(line ${file_content})
278         string(REGEX MATCH "^[ ]+.*\\ref" line1 "${line}")
279         if(line1)
280                 file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc "${line}\n")
281         endif(line1)
282 endforeach(line ${file_content})
283         
284 exec_program("${CMAKE_COMMAND} -E compare_files ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc" OUTPUT_VARIABLE compare_files)
285 if(compare_files)
286         message(STATUS "Wrong toc for gtut-tour.doc Right one is in tmp.realtoc")
287         exec_program("diff -u ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc")
288 else(compare_files)
289         file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc)
290 endif(compare_files)    
291   
292 file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc)
293
294 ADD_CUSTOM_TARGET(pdf
295     COMMAND ${CMAKE_COMMAND} -E echo "XX First pass simgrid_documentation.pdf"
296     COMMAND make clean
297     COMMAND make pdf || true
298     COMMAND ${CMAKE_COMMAND} -E echo "XX Second pass simgrid_documentation.pdf"
299     COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/doc/latex/refman.pdf
300     COMMAND make pdf || true
301     COMMAND ${CMAKE_COMMAND} -E echo "XX Write Simgrid_documentation.pdf"
302     COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_HOME_DIRECTORY}/doc/latex/refman.pdf ${CMAKE_HOME_DIRECTORY}/doc/latex/simgrid_documentation.pdf
303   
304     WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/latex/
305 )
306 add_dependencies(pdf simgrid_documentation)