1 # =======================================================================
2 # Created on: 2014-03-21
4 # Copyright (c) 1996-1999 Matra Datavision
5 # Copyright (c) 1999-2014 OPEN CASCADE SAS
7 # This file is part of Open CASCADE Technology software library.
9 # This library is free software; you can redistribute it and/or modify it under
10 # the terms of the GNU Lesser General Public License version 2.1 as published
11 # by the Free Software Foundation, with special exception defined in the file
12 # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 # distribution for complete text of the license and disclaimer of any warranty.
15 # Alternatively, this file may be used under the terms of Open CASCADE
16 # commercial license or contractual agreement.
18 # =======================================================================
19 # This script defines command gendoc compiling OCCT documents
20 # from *.md files to HTML pages
21 # =======================================================================
23 # load auxiliary tools
24 source [file join [file dirname [info script]] occaux.tcl]
26 # ======================================
28 # ======================================
31 proc OCCDoc_PrintHelpMessage {} {
32 puts "\nUsage: gendoc \[-h\] {-refman|-overview} \[-html|-pdf|-chm\] \[-m=<list of modules>|-ug=<list of docs>\] \[-v\] \[-s=<search_mode>\] \[-mathjax=<path>\]"
36 puts "choice of documentation to be generated:"
37 puts " -overview : To generate Overview and User Guides"
38 puts " (cannot be used with -refman)"
39 puts " -refman : To generate class Reference Manual"
40 puts " (cannot be used with -overview)"
42 puts "choice of output format:"
43 puts " -html : To generate HTML files"
44 puts " (default, cannot be used with -pdf or -chm)"
45 puts " -pdf : To generate PDF files"
46 puts " (cannot be used with -refman, -html, or -chm)"
47 puts " -chm : To generate CHM files"
48 puts " (cannot be used with -html or -pdf)"
50 puts "additional options:"
51 puts " -m=<modules_list> : List of OCCT modules (separated with comma),"
52 puts " for generation of Reference Manual"
53 puts " -ug=<docs_list> : List of MarkDown documents (separated with comma),"
54 puts " to use for generation of Overview / User Guides"
55 puts " -mathjax=<path> : To use local or alternative copy of MathJax"
56 puts " -s=<search_mode> : Specifies the Search mode of HTML documents"
57 puts " Can be: none | local | server | external"
58 puts " -h : Prints this help message"
59 puts " -v : Enables more verbose output"
62 # A command for User Documentation compilation
67 set GEN_MODE "HTML_ONLY"
72 set SEARCH_MODE "none"
73 set MATHJAX_LOCATION "http://cdn.mathjax.org/mathjax/latest"
74 set mathjax_js_name "MathJax.js"
75 set DOCTYPE_COMBO_FLAG 0
76 set GENMODE_COMBO_FLAG 0
77 set GENERATE_PRODUCTS_REFMAN "NO"
79 global available_docfiles; # The full list of md files for HTML or CHM generation
80 global available_pdf; # The full list of md files for PDF generation
86 # Load list of docfiles
87 if { [OCCDoc_LoadFilesList] != 0 } {
88 puts "Error: File FILES_HTML.txt or FILES_PDF.txt was not found on this computer.\nAborting..."
93 if {[OCCDoc_ParseArguments $args] == 1} {
97 # Print help message if no arguments provided
98 if {[llength $args_names] == 0} {
99 OCCDoc_PrintHelpMessage
103 foreach arg_n $args_names {
105 OCCDoc_PrintHelpMessage
107 } elseif {$arg_n == "html"} {
108 if { ([ lsearch $args_names "refman" ] == -1) &&
109 ([ lsearch $args_names "overview" ] == -1) } {
110 puts "Warning: Please specify -refman or -overview argument."
113 if { [ lsearch $args_names "refman" ] != -1 } {
116 if { $GENMODE_COMBO_FLAG != 1 } {
117 set GEN_MODE "HTML_ONLY"
118 set GENMODE_COMBO_FLAG 1
120 puts "Error: Options -html, -pdf and -chm can not be combined."
123 } elseif {$arg_n == "chm"} {
124 if { ([ lsearch $args_names "refman" ] == -1) &&
125 ([ lsearch $args_names "overview" ] == -1) } {
126 puts "Warning: Please specify -refman or -overview argument."
129 if { [ lsearch $args_names "refman" ] != -1 } {
132 if { $GENMODE_COMBO_FLAG != 1 } {
133 set GEN_MODE "CHM_ONLY"
134 set GENMODE_COMBO_FLAG 1
136 puts "Error: Options -html, -pdf and -chm cannot be combined."
139 } elseif {$arg_n == "pdf"} {
140 if { ([ lsearch $args_names "refman" ] == -1) &&
141 ([ lsearch $args_names "overview" ] == -1) } {
142 puts "Warning: Please specify -refman or -overview argument."
145 if { [ lsearch $args_names "refman" ] != -1 } {
148 if { $GENMODE_COMBO_FLAG != 1 } {
149 set GEN_MODE "PDF_ONLY"
150 set GENMODE_COMBO_FLAG 1
152 puts "Error: Options -html, -pdf and -chm cannot be combined."
155 } elseif {$arg_n == "overview"} {
156 if { $DOCTYPE_COMBO_FLAG != 1 } {
157 set DOC_TYPE "OVERVIEW"
158 set DOCTYPE_COMBO_FLAG 1
160 puts "Error: Options -refman and -overview cannot be combined."
164 # Print ignored options
165 if { [ lsearch $args_names "m" ] != -1 } {
166 puts "\nInfo: The following options will be ignored: \n"
170 } elseif {$arg_n == "refman"} {
171 if { $DOCTYPE_COMBO_FLAG != 1 } {
172 set DOC_TYPE "REFMAN"
173 set DOCTYPE_COMBO_FLAG 1
174 if { [info exists env(PRODROOT)] && [file exists $::env(PRODROOT)/src/VAS/Products.tcl] } {
175 set GENERATE_PRODUCTS_REFMAN "YES"
178 puts "Error: Options -refman and -overview cannot be combined."
181 # Print ignored options
182 if { ([ lsearch $args_names "pdf" ] != -1) ||
183 ([ lsearch $args_names "chm" ] != -1) ||
184 ([ lsearch $args_names "ug" ] != -1) } {
185 puts "\nInfo: The following options will be ignored: \n"
186 if { [ lsearch $args_names "pdf" ] != -1 } {
189 if { [ lsearch $args_names "chm" ] != -1 } {
192 if { [ lsearch $args_names "ug" ] != -1 } {
198 } elseif {$arg_n == "v"} {
200 } elseif {$arg_n == "ug"} {
201 if { ([ lsearch $args_names "refman" ] != -1) } {
204 if {$args_values(ug) != "NULL"} {
205 set DOCFILES $args_values(ug)
207 puts "Error in argument ug."
210 # Check if all chosen docfiles are correct
211 foreach docfile $DOCFILES {
212 if { [ lsearch $args_names "pdf" ] == -1 } {
213 # Check to generate HTMLs
214 if { [lsearch $available_docfiles $docfile] == -1 } {
215 puts "Error: File \"$docfile\" is not presented in the list of available docfiles."
216 puts " Please specify the correct docfile name."
220 # Check to generate PDFs
221 if { [lsearch $available_pdf $docfile] == -1 } {
222 puts "Error: File \"$docfile\" is not presented in the list of generic PDFs."
223 puts " Please specify the correct pdf name."
228 } elseif {$arg_n == "m"} {
229 if { [ lsearch $args_names "overview" ] != -1 } {
232 if {$args_values(m) != "NULL"} {
233 set MODULES $args_values(m)
235 puts "Error in argument m."
238 } elseif {$arg_n == "s"} {
239 if { [ lsearch $args_names "pdf" ] != -1 } {
242 if {$args_values(s) != "NULL"} {
243 set SEARCH_MODE $args_values(s)
245 puts "Error in argument s."
248 } elseif {$arg_n == "mathjax"} {
249 if { [ lsearch $args_names "pdf" ] != -1 } {
250 set possible_mathjax_loc $args_values(mathjax)
251 if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
252 set MATHJAX_LOCATION $args_values(mathjax)
253 puts "$MATHJAX_LOCATION"
255 puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
256 puts " MathJax will be used from $MATHJAX_LOCATION"
259 puts "Warning: MathJax is not used with pdf and will be ignored."
262 puts "\nWrong argument: $arg_n"
263 OCCDoc_PrintHelpMessage
268 # Check the existence of the necessary tools
275 OCCDoc_DetectNecessarySoftware $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH $PDFLATEX_PATH
277 if {$DOXYGEN_PATH == ""} {
282 if {"$::tcl_platform(platform)" == "windows"} {
283 if { ($GEN_MODE == "CHM_ONLY") && ($HHC_PATH == "") } {
289 if { ($PDFLATEX_PATH == "") && ($GEN_MODE == "PDF_ONLY") } {
294 # If we do not specify list for docfiles with -m argument,
295 # we assume that we have to generate all docfiles
296 if { [llength $DOCFILES] == 0 } {
297 if { $GEN_MODE != "PDF_ONLY" } {
298 set DOCFILES $available_docfiles
300 set DOCFILES $available_pdf
307 set DOXYLOG [OCCDoc_GetRootDir]/doc/doxygen_warnings_and_errors.log
308 set PDFLOG [OCCDoc_GetRootDir]/doc/pdflatex_warnings_and_errors.log
310 file delete -force $PDFLOG
311 file delete -force $DOXYLOG
313 # Start main activities
314 if { $GEN_MODE != "PDF_ONLY" } {
315 OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
317 puts "Generating OCCT User Guides in PDF format...\n"
318 foreach pdf $DOCFILES {
320 puts "Info: Processing file $pdf\n"
322 # Some values are hardcoded because they are related only to PDF generation
323 OCCDoc_Main "OVERVIEW" [list $pdf] {} "PDF_ONLY" $VERB_MODE "none" $MATHJAX_LOCATION "NO" $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
325 puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
326 puts "\nPDF files are generated in \n[file normalize [OCCDoc_GetRootDir]/doc/pdf]"
330 # Main procedure for documents compilation
331 proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode searchMode mathjaxLocation generateProductsRefman DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH} {
333 global available_docfiles
337 if { [string compare -nocase $generateProductsRefman "YES"] == 0 } {
338 set PRODPATH "$::env(PRODROOT)"
341 set ROOTDIR [OCCDoc_GetRootDir $PRODPATH]
342 set INDIR [OCCDoc_GetDoxDir]
343 set OUTDIR $ROOTDIR/doc
344 set PDFDIR $OUTDIR/pdf
345 set UGDIR $PDFDIR/user_guides
346 set DGDIR $PDFDIR/dev_guides
347 set TAGFILEDIR $OUTDIR/refman
348 set HTMLDIR $OUTDIR/overview/html
349 set LATEXDIR $OUTDIR/overview/latex
350 set DOXYFILE $OUTDIR/OCCT.cfg
352 # Create or cleanup the output folders
353 if { [string compare -nocase $generateProductsRefman "YES"] != 0 } {
354 if { ![file exists $OUTDIR] } {
357 if { ![file exists $HTMLDIR] } {
360 if { ![file exists $PDFDIR] } {
363 if { ![file exists $UGDIR] } {
366 if { ![file exists $DGDIR] } {
369 if { [file exists $LATEXDIR] } {
370 file delete -force $LATEXDIR
374 if { $docType == "REFMAN" } {
375 if { ![file exists $TAGFILEDIR] } {
376 file mkdir $TAGFILEDIR
381 set mathjax_relative_location $mathjaxLocation
382 if { [file isdirectory "$mathjaxLocation"] } {
383 if { $generatorMode == "HTML_ONLY" } {
385 set mathjax_relative_location [OCCDoc_GetRelPath $HTMLDIR $mathjaxLocation]
386 } elseif { $generatorMode == "CHM_ONLY" } {
388 set mathjax_relative_location [file normalize $mathjaxLocation]
392 if { $generateProductsRefman == "YES" } {
393 set DOCDIR "$OUTDIR/refman"
394 puts "\nGenerating OCC Products Reference Manual\n"
396 if { $docType == "REFMAN"} {
397 set DOCDIR "$OUTDIR/refman"
398 puts "\nGenerating Open CASCADE Reference Manual\n"
399 } elseif { $docType == "OVERVIEW" } {
400 set DOCDIR "$OUTDIR/overview"
402 if { ($generatorMode == "HTML_ONLY") || ($generatorMode == "CHM_ONLY") } {
403 if { $generatorMode == "HTML_ONLY" } {
404 set FORMAT " in HTML format..."
405 } elseif { $generatorMode == "CHM_ONLY" } {
406 set FORMAT " in CHM format..."
408 puts "Generating OCCT User Guides$FORMAT\n"
411 puts "Error: Invalid documentation type: $docType. Can not process."
417 puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating Doxyfile..."
419 if { [OCCDoc_MakeDoxyfile $docType $DOCDIR $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $modules $verboseMode $searchMode $HHC_PATH $mathjax_relative_location $GRAPHVIZ_PATH $PRODPATH] == -1 } {
424 set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
426 if { ($generatorMode == "HTML_ONLY") || ($docType == "REFMAN") } {
427 puts "$starttimestamp Generating HTML files..."
429 # Copy index file to provide fast access to HTML documentation
430 file copy -force $INDIR/resources/index.html $DOCDIR/index.html
431 } elseif { $generatorMode == "CHM_ONLY" } {
432 puts "$starttimestamp Generating CHM file..."
433 } elseif { $generatorMode == "PDF_ONLY" } {
434 puts "$starttimestamp Generating PDF file..."
437 set DOXYLOG $OUTDIR/doxygen_warnings_and_errors.log
438 set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $OUTDIR/doxygen_out.log} DOX_ERROR]
440 set NbErrors [regexp -all -line {^\s*[^\s]+} $DOX_ERROR]
442 puts "\nWarning: Doxygen reported $NbErrors messages."
443 puts "See log in $DOXYLOG\n"
444 set DOX_ERROR_FILE [open $DOXYLOG "a"]
445 if {$generatorMode == "PDF_ONLY"} {
446 puts $DOX_ERROR_FILE "\n===================================================="
447 puts $DOX_ERROR_FILE "Logfile for $docfiles"
448 puts $DOX_ERROR_FILE "====================================================\n"
450 puts $DOX_ERROR_FILE $DOX_ERROR
451 close $DOX_ERROR_FILE
455 # Close the Doxygen application
458 # Start Post Processing
459 set curtime [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
460 if { $docType == "REFMAN" } {
461 # Post Process generated HTML pages and draw dependency graphs
462 if {[OCCDoc_PostProcessor $DOCDIR] == 0} {
463 puts "$curtime Generation completed."
464 puts "\nInfo: doxygen log file is located in:"
465 puts "$OUTDIR/doxygen_out.log."
466 puts "\nReference Manual is generated in \n$DOCDIR"
468 } elseif { $docType == "OVERVIEW" } {
469 # Start PDF generation routine
470 if { $generatorMode == "PDF_ONLY" } {
471 set OS $::tcl_platform(platform)
472 if { $OS == "unix" } {
474 } elseif { $OS == "windows" } {
478 # Prepare a list of TeX files, generated by Doxygen
481 set TEXFILES [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
482 foreach path $TEXFILES {
483 if { [string compare -nocase $path $LATEXDIR] == 0 } {
484 set DEL_IDX [lsearch $TEXFILES $path]
485 if { $DEL_IDX != -1 } {
486 set TEXFILES [lreplace $TEXFILES $DEL_IDX $DEL_IDX]
490 set TEXFILES [string map [list refman.tex ""] $TEXFILES]
491 if {$verboseMode == "YES"} {
492 puts "Info: Preprocessing generated TeX files..."
494 OCCDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
496 if {$verboseMode == "YES"} {
497 puts "Info: Converting SVG images to PNG format..."
500 if { $INKSCAPE_PATH != "" } {
501 OCCDoc_ProcessSvg $LATEXDIR $verboseMode
503 puts "Warning: SVG images will be lost in PDF documents."
506 if {$verboseMode == "YES"} {
507 puts "Info: Generating PDF file from TeX files..."
509 foreach TEX $TEXFILES {
510 # Rewrite existing REFMAN.tex file...
511 set TEX [lindex [split $TEX "."] 0]
513 if {$verboseMode == "YES"} {
514 puts "Info: Generating PDF file from $TEX..."
517 OCCDoc_MakeRefmanTex $TEX $LATEXDIR $verboseMode $available_pdf
519 if {"$::tcl_platform(platform)" == "windows"} {
524 if {$verboseMode == "YES"} {
525 # ...and use it to generate PDF from TeX...
526 if {$is_win == "yes"} {
527 puts "Info: Executing $LATEXDIR/make.bat..."
529 puts "Info: Executing $LATEXDIR/Makefile..."
532 set PDFLOG $OUTDIR/pdflatex_warnings_and_errors.log
534 if {"$is_win" == "yes"} {
535 set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
537 set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
539 # Small workaround for *nix stations
542 set RESULT [catch {eval exec "pdflatex refman.tex" >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
547 set NbErrors [regexp -all -line {^\s*[^\s]+} $LaTeX_ERROR]
549 puts "\nWarning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG\n"
550 set LaTeX_ERROR_FILE [open $PDFLOG "a"]
551 puts $LaTeX_ERROR_FILE "\n===================================================="
552 puts $LaTeX_ERROR_FILE "Logfile of file $TEX:"
553 puts $LaTeX_ERROR_FILE "====================================================\n"
554 puts $LaTeX_ERROR_FILE $LaTeX_ERROR
555 close $LaTeX_ERROR_FILE
559 # ...and place it to the specific folder
560 if {![file exists "$LATEXDIR/refman.pdf"]} {
561 puts "Fatal: PDFLaTeX failed to create output file, stopping!"
565 set destFolder $PDFDIR
566 set parsed_string [split $TEX "_"]
567 if { [lsearch $parsed_string "tutorial"] != -1 } {
568 set TEX [string map [list occt__ occt_] $TEX]
569 set destFolder $PDFDIR
570 } elseif { [lsearch $parsed_string "user"] != -1 } {
571 set TEX [string map [list user_guides__ ""] $TEX]
572 set destFolder $UGDIR
573 } elseif { [lsearch $parsed_string "dev"] != -1 } {
574 set TEX [string map [list dev_guides__ ""] $TEX]
575 set destFolder $DGDIR
577 file rename -force $LATEXDIR/refman.pdf "$destFolder/$TEX.pdf"
580 } elseif { $generatorMode == "CHM_ONLY" } {
581 file rename $OUTDIR/overview.chm $OUTDIR/occt_overview.chm
585 if { $generatorMode == "HTML_ONLY" } {
586 puts "\nHTML documentation is generated in \n$DOCDIR"
588 if { $generatorMode == "CHM_ONLY" } {
589 puts "\nGenerated CHM documentation is in \n$OUTDIR/overview.chm"
595 # Remove temporary Doxygen files
596 set deleteList [glob -nocomplain -type f "*.tmp"]
597 foreach file $deleteList {
603 # Generates Doxygen configuration file for Overview documentation
604 proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMode ""} {DocFilesList {}} {ModulesList {}} verboseMode searchMode hhcPath mathjaxLocation graphvizPath productsPath} {
606 set inputDir [OCCDoc_GetDoxDir]
607 set TEMPLATES_DIR $inputDir/resources
608 set occt_version [OCCDoc_DetectCasVersion]
610 # Delete existent doxyfile
611 file delete $doxyFileName
613 # Copy specific template to the target folder
614 if { $docType == "REFMAN" } {
615 file copy "$TEMPLATES_DIR/occt_rm.doxyfile" $doxyFileName
616 } elseif { $docType == "OVERVIEW" } {
617 if { $generatorMode == "HTML_ONLY" || $generatorMode == "CHM_ONLY" } {
618 file copy "$TEMPLATES_DIR/occt_ug_html.doxyfile" $doxyFileName
619 } elseif { $generatorMode == "PDF_ONLY"} {
620 file copy "$TEMPLATES_DIR/occt_ug_pdf.doxyfile" $doxyFileName
622 puts "Error: Unknown generation mode"
626 puts "Error: Cannot generate unknown document type"
630 set doxyFile [open $doxyFileName "a"]
631 # Write specific options
632 if { $docType == "REFMAN" } {
634 # Load lists of modules scripts
635 if { $productsPath == "" } {
636 set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
638 set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/VAS/" *.tcl]
640 if { [llength $modules_scripts] != 0} {
641 foreach module_file $modules_scripts {
646 set ALL_MODULES [OCCDoc_GetModulesList $productsPath]
647 if { [llength $ModulesList] == 0 } {
648 # by default take all modules
649 set modules $ALL_MODULES
651 set modules $ModulesList
654 # Detect invalid names of modules
655 foreach module $modules {
656 if { $module == "" } {
659 if {[lsearch $ALL_MODULES $module] == -1 } {
660 puts "Error: No module $module is known. Aborting..."
666 set one_module [expr [llength $modules] == 1]
668 set title "OCCT [$modules:name]"
671 set title "Open CASCADE Technology"
675 # Get list of header files in the specified modules
677 foreach module $modules {
678 if { $module == "" } {
681 foreach tk [$module:toolkits] {
682 foreach pk [split [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $productsPath]]] {
683 if { [llength $pk] != "{}" } {
684 lappend filelist [OCCDoc_GetHeadersList "p" "$pk" "$productsPath"]
690 # Filter out files Handle_*.hxx and *.lxx
692 foreach fileset $filelist {
694 foreach hdr $fileset {
695 if { ! [regexp {Handle_.*[.]hxx} $hdr] && ! [regexp {.*[.]lxx} $hdr] } {
699 lappend hdrlist $hdrset
701 set filelist $hdrlist
703 set doxyFile [open $doxyFileName "a"]
705 puts $doxyFile "PROJECT_NAME = \"$title\""
706 puts $doxyFile "PROJECT_NUMBER = $occt_version"
707 puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
708 puts $doxyFile "GENERATE_TAGFILE = $outDir/${name}.tag"
710 if { [string tolower $searchMode] == "none" } {
711 puts $doxyFile "SEARCHENGINE = NO"
712 puts $doxyFile "SERVER_BASED_SEARCH = NO"
713 puts $doxyFile "EXTERNAL_SEARCH = NO"
715 puts $doxyFile "SEARCHENGINE = YES"
716 if { [string tolower $searchMode] == "local" } {
717 puts $doxyFile "SERVER_BASED_SEARCH = NO"
718 puts $doxyFile "EXTERNAL_SEARCH = NO"
719 } elseif { [string tolower $searchMode] == "server" } {
720 puts $doxyFile "SERVER_BASED_SEARCH = YES"
721 puts $doxyFile "EXTERNAL_SEARCH = NO"
722 } elseif { [string tolower $searchMode] == "external" } {
723 puts $doxyFile "SERVER_BASED_SEARCH = YES"
724 puts $doxyFile "EXTERNAL_SEARCH = YES"
726 puts "Error: Wrong search engine type: $searchMode."
732 puts $doxyFile "DOTFILE_DIRS = $outDir/html"
733 puts $doxyFile "DOT_PATH = $graphvizPath"
734 puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetSourceDir $productsPath]"
736 # list of files to generate
737 set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]
739 puts $doxyFile "INPUT = $mainpage \\"
740 foreach header $filelist {
741 puts $doxyFile " $header \\"
744 puts $doxyFile "MATHJAX_FORMAT = HTML-CSS"
745 puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
749 } elseif { $docType == "OVERVIEW" } {
751 # Add common options for generation of Overview and User Guides
752 puts $doxyFile "PROJECT_NUMBER = $occt_version"
753 puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
754 puts $doxyFile "PROJECT_LOGO = $inputDir/resources/occ_logo.png"
756 set PARAM_INPUT "INPUT ="
757 set PARAM_IMAGEPATH "IMAGE_PATH = $inputDir/resources/ "
758 foreach docFile $DocFilesList {
759 set NEW_IMG_PATH "$inputDir/$docFile"
760 if { [string compare $NEW_IMG_PATH [OCCDoc_GetRootDir $productsPath]] != 0 } {
761 set img_string [file dirname $NEW_IMG_PATH]/images
762 if { [file exists $img_string] } {
763 append PARAM_IMAGEPATH " $img_string"
766 append PARAM_INPUT " " $inputDir/$docFile
768 puts $doxyFile $PARAM_INPUT
769 puts $doxyFile $PARAM_IMAGEPATH
771 # Add document type-specific options
772 if { $generatorMode == "HTML_ONLY"} {
774 puts $doxyFile "GENERATE_TREEVIEW = YES"
776 # Set a reference to a TAGFILE
777 if { $tagFileDir != "" } {
778 if {[file exists $tagFileDir/OCCT.tag] == 1} {
779 #set tagPath [OCCDoc_GetRelPath $tagFileDir $outDir/html]
780 set tagPath $tagFileDir
781 puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=../../refman/html"
784 # HTML Search engine options
785 if { [string tolower $searchMode] == "none" } {
786 puts $doxyFile "SEARCHENGINE = NO"
787 puts $doxyFile "SERVER_BASED_SEARCH = NO"
788 puts $doxyFile "EXTERNAL_SEARCH = NO"
790 puts $doxyFile "SEARCHENGINE = YES"
791 if { [string tolower $searchMode] == "local" } {
792 puts $doxyFile "SERVER_BASED_SEARCH = NO"
793 puts $doxyFile "EXTERNAL_SEARCH = NO"
794 } elseif { [string tolower $searchMode] == "server" } {
795 puts $doxyFile "SERVER_BASED_SEARCH = YES"
796 puts $doxyFile "EXTERNAL_SEARCH = NO"
797 } elseif { [string tolower $searchMode] == "external" } {
798 puts $doxyFile "SERVER_BASED_SEARCH = YES"
799 puts $doxyFile "EXTERNAL_SEARCH = YES"
801 puts "Error: Wrong search engine type: $searchMode."
806 } elseif { $generatorMode == "CHM_ONLY"} {
807 # specific options for CHM file generation
808 puts $doxyFile "GENERATE_TREEVIEW = NO"
809 puts $doxyFile "SEARCHENGINE = NO"
810 puts $doxyFile "GENERATE_HTMLHELP = YES"
811 puts $doxyFile "CHM_FILE = ../../overview.chm"
812 puts $doxyFile "HHC_LOCATION = \"$hhcPath\""
813 puts $doxyFile "DISABLE_INDEX = YES"
817 puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"