a370c09dbb1a7d82854623cf0796e72442e9a652
[occt.git] / dox / dev_guides / building / code_blocks.md
1 Building with Code::Blocks {#occt_dev_guides__building_code_blocks}
2 ==========================
3
4 @tableofcontents
5
6 @section build_codeblocks_intro General
7
8 This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using project files generated by OCCT legacy tool **genproj**.
9 It can be used as an alternative to CMake build system (see @ref occt_dev_guides__building_cmake) for all supported platforms.
10
11 @section build_codeblocks_3rdparty Third-party libraries
12
13 Before building OCCT, make sure to have all the needed third-party libraries installed, see @ref occt_dev_guides__building.
14
15 @section build_codeblocks_conf Configuration
16
17 Before building it is necessary to set up build environment.
18
19 The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited directly:
20
21 * Add paths to includes of used third-party libraries in variable *CSF_OPT_INC*. 
22 * Add paths to their binary libraries in variable  *CSF_OPT_LIB64*.
23 * Set variable *SHORTCUT_HEADERS* to "true" to have folder *inc* populated by short-cut files pointing to actual headers located in *src*; otherwise, header files will be copied to *inc*.
24 * For optional  third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*,  e.g.:
25 ~~~~~
26        export HAVE_GL2PS=false
27 ~~~~~
28
29 Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure environment interactively:
30
31 @figure{/dev_guides/building/3rdparty/images/genconf_linux.png}
32
33 Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
34   
35 @section build_codeblocks_gen Projects generation
36
37 Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files:
38
39 ~~~~~
40   $ cd /dev/OCCT/opencascade-7.0.0
41   $ ./genproj cbp
42 ~~~~~
43
44 The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
45
46 @note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
47
48 @section build_codeblocks_build Building
49
50 To start **Code::Blocks**, launch script *codeblocks.sh*.
51
52 To build all toolkits, click **Build->Build workspace** in the menu bar.
53
54 To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
55 ~~~~~
56    ./draw_cbp.sh cbp [d]
57 ~~~~~
58 Option *d* is used if OCCT has been built in **Debug** mode.