documentation updated
[occt.git] / dox / dev_guides / building / wok / wok.md
CommitLineData
e5bd0d98 1Using WOK {#dev_guides__building__wok}
dba69de2 2=========
3
e5bd0d98 4@tableofcontents
5
6\ref dev_guides__wok "WOK" is a legacy build environment for Open CASCADE Technology.
7It is required for generation of header files for classes defined with
8@ref dev_guides__cdl "CDL" ("Cascade Definition Language").
9Also tools for generation of project files for other build systems, and OCCT
10documentation, are integrated to WOK.
dba69de2 11
12WOK thus is needed in the following situations:
13- Building from OCCT sources from Git repository (do not contain generated files)
14- Building after some changes made in CDL files
15
e5bd0d98 16Before installing and using WOK, make sure that you have installed a compiler
17(it is assumed that it is Visual Studio on Windows or gcc on Linux and MacOS)
18and third-party components required for building OCCT.
dba69de2 19
20@section wok1 Installing WOK
21
22 Download the latest version of binary distribution WOK from http://dev.opencascade.org/index.php?q=home/resources
23
24@subsection wok11 Windows
25
26 Run the installer. You will be prompted to read and accept the OCCT Public License to proceed:
27
e5bd0d98 28 @image html /dev_guides/building/wok/images/wok_image001.png
29 @image latex /dev_guides/building/wok/images/wok_image001.png
dba69de2 30
31 Click Next and proceed with the installation.
32 At the end of the installation you will be prompted to specify the version and the location of Visual Studio to be used, and the location of third-party libraries:
33
e5bd0d98 34 @image html /dev_guides/building/wok/images/wok_image002.png
35 @image latex /dev_guides/building/wok/images/wok_image002.png
dba69de2 36
37 You can change these settings at any time later. For this click on the item "Customize environment (GUI tool)" in the WOK group in the Windows Start menu.
38
39 The shortcuts from this group provide two ways to run WOK:
40 * In command prompt window ("WOK TCL shell").
41 * In Emacs editor ("WOK Emacs"). Using Emacs is convenient if you need to work within WOK environment.
42
43 By default WOK installer creates a WOK factory with name "LOC" within workshop "dev" (WOK path :LOC:dev).
44
45@subsection wok12 Linux
46
e5bd0d98 47 * Unpack the .tgz archive containing WOK distributive into an installation directory \<WOK_INSTALL_DIR\>.
dba69de2 48
e5bd0d98 49 * Perform the following commands assuming that you have unpacked WOK distributive archive into \<WOK_INSTALL_DIR\>:
dba69de2 50 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
e5bd0d98 51 cd \<WOK_INSTALL_DIR\>/site
dba69de2 52 wok_confgui.sh
53 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54
55 Define all necessary paths to third-party products in the dialog window:
56
e5bd0d98 57 @image html /dev_guides/building/wok/images/wok_image003.png
58 @image latex /dev_guides/building/wok/images/wok_image003.png
dba69de2 59
60 * Run the following commands to create WOK LOC factory:
61 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
e5bd0d98 62 cd \<WOK_INSTALL_DIR\>/site
dba69de2 63 wok_init.sh
64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
66 * Your installation procedure is over. To run WOK use one the following commands:
67 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
e5bd0d98 68 cd \<WOK_INSTALL_DIR\>/site
dba69de2 69 wok_emacs.sh
70 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 or
72 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
e5bd0d98 73 cd \<WOK_INSTALL_DIR\>/site
dba69de2 74 wok_tclsh.sh
75 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76
77@subsection wok13 Mac OS X
78
e5bd0d98 79 * In the Finder double click on wokSetup.dmg file. This will open a new window. Drag and drop "wokSetup" folder from this window at the location in the Finder where you want to install WOK, i.e. \<WOK_INSTALL_DIR\>.
dba69de2 80
e5bd0d98 81 * Browse in the Finder to the folder \<WOK_INSTALL_DIR\>/site and double click on WokConfig. This will open a window with additional search path settings. Define all necessary paths to third-party products in the dialog window:
dba69de2 82
e5bd0d98 83 @image html /dev_guides/building/wok/images/wok_image004.png
84 @image latex /dev_guides/building/wok/images/wok_image004.png
dba69de2 85
86 * Run the following commands to create WOK LOC factory:
87 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
e5bd0d98 88 cd \<WOK_INSTALL_DIR\>/site
dba69de2 89 wok_init.sh
90 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91
e5bd0d98 92 * Your installation procedure is over. To run WOK in Emacs navigate in the Finder to the folder \<WOK_INSTALL_DIR\>/site and double click on WokEmacs.
dba69de2 93
94
95@section wok2 Initialization of Workbench
96
97 To start working with OCCT, clone the OCCT Git repository from the server (see http://dev.opencascade.org/index.php?q=home/resources for details) or unpack the source archive.
98
99 Then create a WOK workbench (command wcreate) setting its Home to the directory, where the repository is created ($CASROOT variable). The workbench should have the same name as that directory.
100
101 For example, assuming that OCCT repository has been cloned into D:/occt folder:
102 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
103 LOC:dev> wcreate occt -DHome=D:/occt
104 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105
106 Note: $CASROOT is equal to D:/occt now
107
e5bd0d98 108 Then you can work with this workbench using normal WOK functionality (wprocess, umake, etc.; see WOK User's Guide for details) or use it only for generation of derived sources and project files, and build OCCT with Visual Studio on Windows or make command on Linux, as described below.
dba69de2 109
110@section wok3 Generation of building projects
111
112 Use command wgenproj in WOK to generate derived headers, source and building projects files:
113 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
114 LOC:dev> wokcd occt
115 LOC:dev:occt> wgenproj [ -target=<TARGET> ] [ -no_wprocess ]
116 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117TARGET:
118 * vc8 - Visual Studio 2005
119 * vc9 - Visual Studio 2008
120 * vc10 - Visual Studio 2010
121 * vc11 - Visual Studio 2012
122 * cbp - CodeBlocks
123 * cmake - CMake
124 * amk - AutoMake
125 * xcd - Xcode
126-no_wprocess - skip generation of derived headers and source files
127
128Note that this command takes several minutes to complete at the first call.
129
130Re-execute this step to generate derived headers, source and building projects files if some CDL files in OCCT have been modified (either by you directly, or due to updates in the repository). Note that in some cases WOK may fail to update correctly; in such case remove sub-directories drv and .adm and repeat the command.
131
132To regenerate derived headers and source files without regeneration of projects use command:
133 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
134 LOC:dev> wokcd occt
135 LOC:dev:occt> wprocess -DGroups=Src,Xcpp
136 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137The generated building project has been placed into $CASROOT/adm folder:
138 * for vc8 - $CASROOT/adm/msvc/vc8
139 * for vc9 - $CASROOT/adm/msvc/vc9
140 * for vc10 - $CASROOT/adm/msvc/vc10
141 * for vc11 - $CASROOT/adm/msvc/vc11
e5bd0d98 142 * for cbp - $CASROOT/adm/\<OS\>/cbp
dba69de2 143 * for cmake - $CASROOT/adm/cmake
144 * for amk - $CASROOT/adm/lin/amk
e5bd0d98 145 * xcd - $CASROOT/adm/\<OS\>/xcd
dba69de2 146
147@section wok4 Generation of documentation
148
149 Use command wgendoc in WOK to generate reference documentation:
150 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
151 :LOC:dev> wokcd occt
152 :LOC:dev:occt> wgendoc
153 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154The following options can be used:
155 * -wb=< workbench name > the name of OCCT workbench (the current one by default);
156 * -m=< list of modules > the list of modules that will be contained in the documentation;
157 * -outdir=< path > the output directory for the documentation;
158 * -chm the option to generate CHM file;
159 * -hhc=< path > the path to HTML Help Compiler (hhc.exe) or equivalent;
160 * -qthelp=< path > the option to generate Qt Help file, it is necessary to specify the path to qthelpgenerator executable;
161 * -doxygen=< path > the path to Doxygen executable
162 * -dot=< path > the path to GraphViz dot executable