0026846: Configuration, genproj.tcl - create hardlinks instead for header redirection
[occt.git] / dox / dev_guides / building / code_blocks.md
CommitLineData
72c37458 1Building with Code::Blocks {#occt_dev_guides__building_code_blocks}
2==========================
72b7576f 3
72c37458 4@tableofcontents
72b7576f 5
72c37458 6@section build_codeblocks_intro General
72b7576f 7
72c37458 8This 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**.
944d808c 9It can be used as an alternative to CMake build system (see @ref occt_dev_guides__building_cmake) for all supported platforms.
72b7576f 10
72c37458 11@section build_codeblocks_3rdparty Third-party libraries
72b7576f 12
72c37458 13Before building OCCT, make sure to have all the needed third-party libraries installed, see @ref occt_dev_guides__building.
72b7576f 14
72c37458 15@section build_codeblocks_conf Configuration
72b7576f 16
72c37458 17Before building it is necessary to set up build environment.
72b7576f 18
72c37458 19The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited directly:
72b7576f 20
72c37458 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*.
5951a088 23* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
24 * *Copy* - headers will be copied from *src*;
25 * *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
26 * "HardLink* - hard links to headers located in *src* will be created.
72c37458 27* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
28~~~~~
29 export HAVE_GL2PS=false
576f8b11 30~~~~~
72b7576f 31
72c37458 32Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure environment interactively:
72b7576f 33
72c37458 34@figure{/dev_guides/building/3rdparty/images/genconf_linux.png}
72b7576f 35
72c37458 36Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
37
38@section build_codeblocks_gen Projects generation
39
944d808c 40Launch **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:
72b7576f 41
576f8b11 42~~~~~
72c37458 43 $ cd /dev/OCCT/opencascade-7.0.0
944d808c 44 $ ./genproj cbp
576f8b11 45~~~~~
72b7576f 46
72c37458 47The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
72b7576f 48
72c37458 49@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
72b7576f 50
72c37458 51@section build_codeblocks_build Building
72b7576f 52
72c37458 53To start **Code::Blocks**, launch script *codeblocks.sh*.
72b7576f 54
72c37458 55To build all toolkits, click **Build->Build workspace** in the menu bar.
72b7576f 56
72c37458 57To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
576f8b11 58~~~~~
72b7576f 59 ./draw_cbp.sh cbp [d]
576f8b11 60~~~~~
72c37458 61Option *d* is used if OCCT has been built in **Debug** mode.