1 Building with Code::Blocks {#occt_dev_guides__building_code_blocks}
2 ==========================
6 @section build_codeblocks_intro General
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 an alternative to use of CMake build system (see @ref occt_dev_guides__building_cmake) for all supported platforms.
11 @section build_codeblocks_3rdparty Third-party libraries
13 Before building OCCT, make sure to have all the needed third-party libraries installed, see @ref occt_dev_guides__building.
15 @section build_codeblocks_conf Configuration
17 Before building it is necessary to set up build environment.
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:
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.:
26 export HAVE_GL2PS=false
29 Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure environment interactively:
31 @figure{/dev_guides/building/3rdparty/images/genconf_linux.png}
33 Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
35 @section build_codeblocks_gen Projects generation
37 Launch **genproj** tool with option *-target=cbp* to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files:
40 $ cd /dev/OCCT/opencascade-7.0.0
41 $ ./genproj.sh -target=cbp
44 The generated Code::Blocks project are placed into subfolder *adm/<OS>/cbp*.
46 @note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
48 @section build_codeblocks_build Building
50 To start **Code::Blocks**, launch script *codeblocks.sh*.
52 To build all toolkits, click **Build->Build workspace** in the menu bar.
54 To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
58 Option *d* is used if OCCT has been built in **Debug** mode.