0027601: TKV3d, AIS_RubberBand - polygonal selection mode invokes an exception with...
[occt.git] / adm / gendoc.tcl
index 2242696..f24c999 100644 (file)
 #
 # Alternatively, this file may be used under the terms of Open CASCADE
 # commercial license or contractual agreement.
-# 
-# Brief:  This script compiles OCCT documents from *.md files to HTML pages
 # =======================================================================
+# This script defines command gendoc compiling OCCT documents 
+# from *.md files to HTML pages
+# =======================================================================
+
+# load auxiliary tools
+source [file join [file dirname [info script]] occaux.tcl]
 
 # ======================================
 #  Common functions
@@ -166,7 +171,7 @@ proc gendoc {args} {
       if { $DOCTYPE_COMBO_FLAG != 1 } { 
         set DOC_TYPE "REFMAN"
         set DOCTYPE_COMBO_FLAG 1
-        if { [file exists [pwd]/src/VAS/Products.tcl] } {
+        if { [info exists env(PRODROOT)] && [file exists $::env(PRODROOT)/src/VAS/Products.tcl] } {
           set GENERATE_PRODUCTS_REFMAN "YES"
         }
       } else {
@@ -190,13 +195,6 @@ proc gendoc {args} {
         puts ""
       }
       
-      if { $GENERATE_PRODUCTS_REFMAN == "YES" } {
-        if { [ lsearch $args_names "m" ] == -1 } {
-          puts "\nError: Cannot generate Reference Manual for the whole set of OCC Products."
-          puts "Aborting..."
-          return -1
-        }
-      }
     } elseif {$arg_n == "v"} {
       set VERB_MODE "YES"
     } elseif {$arg_n == "ug"} {
@@ -306,9 +304,8 @@ proc gendoc {args} {
   puts ""
 
   # Clean logfiles
-  set OUTDIR  [OCCDoc_GetRootDir]/doc/
-  set DOXYLOG $OUTDIR/doxygen_warnings_and_errors.log
-  set PDFLOG  $OUTDIR/pdflatex_warnings_and_errors.log
+  set DOXYLOG [OCCDoc_GetRootDir]/doc/doxygen_warnings_and_errors.log
+  set PDFLOG  [OCCDoc_GetRootDir]/doc/pdflatex_warnings_and_errors.log
 
   file delete -force $PDFLOG
   file delete -force $DOXYLOG
@@ -338,7 +335,7 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
 
   set PRODPATH   ""
   if { [string compare -nocase $generateProductsRefman "YES"] == 0 } {
-    set PRODPATH [pwd]
+    set PRODPATH "$::env(PRODROOT)"
   }
 
   set ROOTDIR    [OCCDoc_GetRootDir $PRODPATH]
@@ -351,7 +348,7 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
   set HTMLDIR    $OUTDIR/overview/html
   set LATEXDIR   $OUTDIR/overview/latex
   set DOXYFILE   $OUTDIR/OCCT.cfg
-
   # Create or cleanup the output folders
   if { [string compare -nocase $generateProductsRefman "YES"] != 0 } {
     if { ![file exists $OUTDIR] } {
@@ -684,7 +681,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
       foreach tk [$module:toolkits] {
         foreach pk [split [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $productsPath]]] {
           if { [llength $pk] != "{}" } {
-            lappend filelist [OCCDoc_GetHeadersList "p" "pubinclude" "$pk" "$productsPath"]
+            lappend filelist [OCCDoc_GetHeadersList "p" "$pk" "$productsPath"]
           }
         }
       }
@@ -734,7 +731,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
 
     puts $doxyFile "DOTFILE_DIRS             = $outDir/html"
     puts $doxyFile "DOT_PATH                 = $graphvizPath"
-    puts $doxyFile "INCLUDE_PATH             = [OCCDoc_GetIncDir $productsPath]"
+    puts $doxyFile "INCLUDE_PATH             = [OCCDoc_GetSourceDir $productsPath]"
     
     # list of files to generate
     set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]