1@echo off
2
3REM This bash script regenerates the HTML doxygen version of the
4REM wxWidgets manual and adjusts the doxygen log to make it more
5REM readable.
6
7where /q doxygen
8if %ERRORLEVEL% neq 0 (
9    echo Error: Doxygen was not found in your PATH.
10    exit /b 1
11)
12
13if not exist out (mkdir out)
14if not exist out\html (mkdir out\html)
15if not exist out\html\generic (mkdir out\html\generic)
16
17REM These not automatically copied by Doxygen because they're not
18REM used in doxygen documentation, only in our html footer and by our
19REM custom aliases
20copy images\generic\*.png out\html\generic 2>&1 >NUL
21
22pushd ..\..
23set WXWIDGETS=%CD%
24popd
25
26REM Defaults for settings controlled by this script
27set GENERATE_DOCSET=NO
28set GENERATE_HTML=NO
29set GENERATE_HTMLHELP=NO
30set GENERATE_LATEX=NO
31set GENERATE_QHP=NO
32set GENERATE_XML=NO
33set SEARCHENGINE=NO
34set SERVER_BASED_SEARCH=NO
35
36IF "%1" == "all" (
37  set GENERATE_HTML=YES
38  set GENERATE_HTMLHELP=YES
39  set GENERATE_XML=YES
40) ELSE (
41  IF "%1" == "chm" (
42    set GENERATE_HTML=YES
43    set GENERATE_HTMLHELP=YES
44  ) ELSE (
45    IF "%1" == "docset" (
46      set GENERATE_DOCSET=YES
47      set GENERATE_HTML=YES
48    ) ELSE (
49      IF "%1" == "latex" (
50        set GENERATE_LATEX=YES
51      ) ELSE (
52        IF "%1" == "php" (
53          set GENERATE_HTML=YES
54          set SEARCHENGINE=YES
55          set SERVER_BASED_SEARCH=YES
56        ) ELSE (
57          IF "%1" == "qch" (
58            set GENERATE_HTML=YES
59            set GENERATE_QHP=YES
60          ) ELSE (
61            IF "%1" == "xml" (
62              set GENERATE_XML=YES
63            ) ELSE (
64              REM Default to HTML format.
65              set GENERATE_HTML=YES
66              set SEARCHENGINE=YES
67            )
68          )
69        )
70      )
71    )
72  )
73)
74
75REM Check for Graphviz (its location should be in %PATH%).
76REM
77REM NB: Always do this check because it looks like errorlevel is not set
78REM     when the test is done inside the IF block.
79dot <NUL >NUL 2>&1
80IF %GENERATE_HTML%==YES (
81    IF NOT %errorlevel%==0 (
82        IF %errorlevel%==9009 (
83            echo Error: dot was not found in PATH, please install Graphviz!
84        ) ELSE (
85            echo Error: %errorlevel% error code when running dot, please check Graphviz installation.
86        )
87
88        EXIT /B
89    )
90)
91
92REM
93REM NOW RUN DOXYGEN
94REM
95REM NB: we do this _after_ copying the required files to the output folders
96REM     otherwise when generating the CHM file with Doxygen, those files are
97REM     not included!
98REM
99set PATH=%PATH%;%HHC_PATH%
100doxygen Doxyfile
101if %errorlevel% neq 0 exit /b %errorlevel%
102
103REM Check that class inheritance diagram images are present for html/chm docs.
104REM
105REM NB: Set the file to check outside the IF block,
106REM     otherwise the second check does not always pick its value.
107set filetofind=out\html\classwx_app_console__inherit__graph.png
108IF %GENERATE_HTML%==YES (
109    IF NOT EXIST %~dp0%filetofind% (
110        echo Warning: Class inheritance diagram images are missing, please check Graphviz installation.
111    )
112)
113