Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Corection of the gtnets-ruby bug with node.h and begining of the doc edition.
[simgrid.git] / buildtools / CPACK / src / CMakeDocs.txt
1 if(MAINTAINER_MODE)
2
3         find_path(FIG2DEV_PATH  NAMES fig2dev   PATHS NO_DEFAULT_PATHS)
4         find_path(DOXYGEN_PATH  NAMES doxygen   PATHS NO_DEFAULT_PATHS)
5         find_path(BIBTOOL_PATH  NAMES bibtool   PATHS NO_DEFAULT_PATHS)
6         find_path(BIBTEX2HTML_PATH      NAMES bibtex2html       PATHS NO_DEFAULT_PATHS)
7         find_path(ICONV_PATH    NAMES iconv     PATHS NO_DEFAULT_PATHS)
8         find_path(MAKE_PATH     NAMES make      PATHS NO_DEFAULT_PATHS)
9
10         exec_program("rm -rf ${PROJECT_DIRECTORY}/doc/html" OUTPUT_VARIABLE OKITOKI)
11         exec_program("mkdir -p ${PROJECT_DIRECTORY}/doc/html" OUTPUT_VARIABLE OKITOKI)
12         exec_program("find ${PROJECT_DIRECTORY}/tools/gras  ${PROJECT_DIRECTORY}/src ${PROJECT_DIRECTORY}/include -name \"*.[chl]\"" OUTPUT_VARIABLE LISTE_UNE)
13         exec_program("find ${PROJECT_DIRECTORY} -name \"*.doc\" |grep -v logcategories.doc" OUTPUT_VARIABLE LISTE_DEUX)
14
15
16         set(DOCSSOURCES "${LISTE_UNE}\n${LISTE_DEUX}")
17         string(REPLACE "\n" ";" DOCSSOURCES ${DOCSSOURCES})
18
19         set(FIGS
20         ${PROJECT_DIRECTORY}/doc/fig/simgrid_modules.fig
21         ${PROJECT_DIRECTORY}/doc/fig/simgrid_modules2.fig
22         ${PROJECT_DIRECTORY}/doc/fig/amok_bw_test.fig
23         ${PROJECT_DIRECTORY}/doc/fig/amok_bw_sat.fig
24         ${PROJECT_DIRECTORY}/doc/fig/gras_comm.fig
25         )
26
27         string(REPLACE ".fig" ".png\n" LISTE_TROIS ${FIGS})
28
29         set(PNGS 
30         ${PROJECT_DIRECTORY}/doc/webcruft/simgrid_logo.png
31         ${PROJECT_DIRECTORY}/doc/webcruft/simgrid_logo_small.png
32         ${PROJECT_DIRECTORY}/doc/webcruft/poster_thumbnail.png
33         )
34
35         SET(PRINT false)
36
37         if(PRINT)
38                 message("DOCSSOURCES:")
39                 foreach(file ${DOCSSOURCES})
40                         message("${file}")
41                 endforeach(file ${DOCSSOURCES})
42
43                 message("\nFIGS:")
44                 foreach(file ${FIGS})
45                         message("${file}")
46                 endforeach(file ${FIGS})
47
48                 message("\nPNGS:")
49                 foreach(file ${PNGS})
50                         message("${file}")
51                 endforeach(file ${PNGS})
52
53         message("${DOXYGEN_PATH}/doxygen")
54         message("${FIG2DEV_PATH}/fig2dev")
55         message("${BIBTOOL_PATH}/bibtool")
56         message("${BIBTEX2HTML_PATH}/bibtex2html")
57         message("${ICONV_PATH}/iconv")
58         message("\n\n")
59
60         endif(PRINT)
61
62         if(DOXYGEN_PATH AND FIG2DEV_PATH)
63
64                 exec_program("${FIG2DEV_PATH}/fig2dev -Lmap ${PROJECT_DIRECTORY}/doc/fig/simgrid_modules.fig | grep -e IMG -e MAP -e AREA | sed 's/imagemap/simgrid_modules/g' | sed 's/\\.gif/.png/' | sed 's/<IMG /<IMG style=\"border:0px \"/g' | sed 's/\\.gif/.png/' > ${PROJECT_DIRECTORY}/doc/simgrid_modules.map" OUTPUT_VARIABLE OKITOKI)
65
66                 foreach(file ${FIGS})
67                         string(REPLACE ".fig" ".png" tmp_file ${file})
68                         string(REPLACE "${PROJECT_DIRECTORY}/doc/fig/" "${PROJECT_DIRECTORY}/doc/html/" tmp_file ${tmp_file})
69                         exec_program("${FIG2DEV_PATH}/fig2dev -Lpng ${file} > ${tmp_file}" OUTPUT_VARIABLE OKITOKI)
70                 endforeach(file ${FIGS})
71
72
73                 exec_program("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" OUTPUT_VARIABLE OKITOKI)
74                 exec_program("test -e html || mkdir html" OUTPUT_VARIABLE OKITOKI)
75
76                 foreach(file ${PNGS})
77                         exec_program("cp ${file} ${PROJECT_DIRECTORY}/doc/html/" OUTPUT_VARIABLE OKITOKI)
78                 endforeach(file ${PNGS})
79
80                 exec_program("cp ${PROJECT_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot_thn.jpg ${PROJECT_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot.jpg ${PROJECT_DIRECTORY}/doc/html/" OUTPUT_VARIABLE OKITOKI)
81                 exec_program("cp ${PROJECT_DIRECTORY}/doc/simgrid.css ${PROJECT_DIRECTORY}/doc/html/" OUTPUT_VARIABLE OKITOKI) 
82
83                 set(top_srcdir "..")
84                 set(WARNING "This file is generated, do not edit")
85                 set(srcdir ".")
86                 configure_file(${PROJECT_DIRECTORY}/doc/Doxyfile.in ${PROJECT_DIRECTORY}/doc/Doxyfile @ONLY)
87         # First pass
88                 exec_program("${DOXYGEN_PATH}/doxygen Doxyfile >/dev/null" OUTPUT_VARIABLE OKITOKI)
89                 exec_program("${PROJECT_DIRECTORY}/tools/doxygen/index_create.pl simgrid.tag index-API.doc" OUTPUT_VARIABLE OKITOKI)
90                 exec_program("${PROJECT_DIRECTORY}/tools/doxygen/toc_create.pl ${PROJECT_DIRECTORY}/FAQ.doc ${PROJECT_DIRECTORY}/doc/index.doc ${PROJECT_DIRECTORY}/doc/contrib.doc ${PROJECT_DIRECTORY}/doc/gtut-introduction.doc ${PROJECT_DIRECTORY}/doc/history.doc" OUTPUT_VARIABLE OKITOKI)
91         # Second pass
92                 exec_program("${DOXYGEN_PATH}/doxygen Doxyfile >/dev/null" OUTPUT_VARIABLE OKITOKI)
93         # Post-processing
94                 exec_program("rm -f ${PROJECT_DIRECTORY}/doc/html/dir*" OUTPUT_VARIABLE OKITOKI)
95                 exec_program("${PROJECT_DIRECTORY}/tools/doxygen/index_php.pl ${PROJECT_DIRECTORY}/doc/index.php.in ${PROJECT_DIRECTORY}/doc/html/index.html ${PROJECT_DIRECTORY}/doc/index.php" OUTPUT_VARIABLE OKITOKI)
96                 exec_program("${PROJECT_DIRECTORY}/tools/doxygen/doxygen_postprocesser.pl" OUTPUT_VARIABLE OKITOKI)
97
98         #html/gras.html:
99                 exec_program("echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>\" > ${PROJECT_DIRECTORY}/doc/html/gras.html" OUTPUT_VARIABLE OKITOKI)
100                 exec_program("echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>Grid Reality And Simulation.</a></h2></center></html>\" >> ${PROJECT_DIRECTORY}/doc/html/gras.html" OUTPUT_VARIABLE OKITOKI)
101         #html/amok.html:
102                 exec_program("echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__AMOK__API.html'>\" > ${PROJECT_DIRECTORY}/doc/html/amok.html" OUTPUT_VARIABLE OKITOKI)
103                 exec_program("echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__AMOK__API.html'>Advanced Metacomputing Overlay Kit.</a></h2></center></html>\" >> ${PROJECT_DIRECTORY}/doc/html/amok.html" OUTPUT_VARIABLE OKITOKI)
104         #html/msg.html:
105                 exec_program("echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__MSG__API.html'>\" > ${PROJECT_DIRECTORY}/doc/html/msg.html" OUTPUT_VARIABLE OKITOKI)
106                 exec_program("echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__MSG__API.html'>Meta SimGrid.</a></h2></center></html>\" >> ${PROJECT_DIRECTORY}/doc/html/msg.html" OUTPUT_VARIABLE OKITOKI)
107         #html/simdag.html:
108                 exec_program("echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__SD__API.html'>\" > ${PROJECT_DIRECTORY}/doc/html/simdag.html" OUTPUT_VARIABLE OKITOKI)
109                 exec_program("echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__SD__API.html'>DAG Simulator.</a></h2></center></html>\" >> ${PROJECT_DIRECTORY}/doc/html/simdag.html" OUTPUT_VARIABLE OKITOKI)
110
111         if(BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH)
112
113         #publis_count.html: all.bib
114                 exec_program("${PROJECT_DIRECTORY}/tools/doxygen/bibtex2html_table_count.pl < ${PROJECT_DIRECTORY}/doc/all.bib > ${PROJECT_DIRECTORY}/doc/publis_count.html" OUTPUT_VARIABLE OKITOKI)
115
116         #publis_core.bib: all.bib 
117                 exec_program("${BIBTOOL_PATH}/bibtool -- 'select.by.string={category \"core\"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' ${PROJECT_DIRECTORY}/doc/all.bib > ${PROJECT_DIRECTORY}/doc/publis_core.bib" OUTPUT_VARIABLE OKITOKI)
118
119         #publis_extern.bib: all.bib 
120                 exec_program("${BIBTOOL_PATH}/bibtool -- 'select.by.string={category \"extern\"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' ${PROJECT_DIRECTORY}/doc/all.bib > ${PROJECT_DIRECTORY}/doc/publis_extern.bib" OUTPUT_VARIABLE OKITOKI)
121
122         #publis_intra.bib: all.bib 
123                 exec_program("${BIBTOOL_PATH}/bibtool -- 'select.by.string={category \"intra\"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' ${PROJECT_DIRECTORY}/doc/all.bib > ${PROJECT_DIRECTORY}/doc/publis_intra.bib" OUTPUT_VARIABLE OKITOKI)
124
125         #%_bib.latin1.html: %.bib
126                 exec_program("find ${PROJECT_DIRECTORY}/doc/ -name \"*.bib\"" OUTPUT_VARIABLE LISTE_QUATRE)
127                 string(REPLACE "\n" ";" LISTE_QUATRE ${LISTE_QUATRE})
128                 foreach(file ${LISTE_QUATRE})
129                         string(REPLACE ".bib" "_bib.latin1.html" file_tmp "${file}")
130                         exec_program("${BIBTEX2HTML_PATH}/bibtex2html -single -i -q ${file} | ${PROJECT_DIRECTORY}/tools/doxygen/bibtex2html_postprocessor.pl > ${file_tmp}\n" OUTPUT_VARIABLE OKITOKI)
131                 endforeach(file ${LISTE_QUATRE})
132
133
134         #%_bib.html: %_bib.latin1.html
135                 exec_program("find ${PROJECT_DIRECTORY}/doc/ -name \"*_bib.latin1.html\"" OUTPUT_VARIABLE LISTE_CINQ)
136                 string(REPLACE "\n" ";" LISTE_CINQ ${LISTE_CINQ})
137                 foreach(file ${LISTE_CINQ})
138                         string(REPLACE "_bib.latin1.html" "_bib.html" file_tmp "${file}")
139                         exec_program("${ICONV_PATH}/iconv --from-code latin1 --to-code utf8 ${file} --output ${file-tmp}" OUTPUT_VARIABLE OKITOKI)
140                 endforeach(file ${LISTE_CINQ})
141         endif(BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH)
142
143         #publish:
144                 #$(MAKE) -C .. sync-gforge
145
146         endif(DOXYGEN_PATH AND FIG2DEV_PATH)
147
148         write_file("${PROJECT_DIRECTORY}/doc/logcategories.sh"
149         "#! /bin/sh     
150         pwd=`pwd`
151         rm -f $pwd/logcategories.doc
152         set -e
153         echo "/* Generated file, do not edit */"        > $pwd/logcategories.doc
154         echo "/** \addtogroup XBT_log_cats"             >> $pwd/logcategories.doc
155         echo "    @{"                                   >> $pwd/logcategories.doc
156         cd ${PROJECT_DIRECTORY}/src
157         ../tools/doxygen/xbt_log_extract_hierarchy.pl   >> $pwd/logcategories.doc
158         echo "@}*/"                                     >> $pwd/logcategories.doc"
159         )
160         exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/doc/logcategories.sh")
161         exec_program("${PROJECT_DIRECTORY}/doc/logcategories.sh")
162
163
164 endif(MAINTAINER_MODE)
165
166
167
168
169
170
171
172
173
174
175
176
177
178