0022859: Developers guide with code samples
[occt.git] / dox / dev_guides / building / xcode.md
CommitLineData
ba06f8bb 1Building with Xcode {#occt_dev_guides__building_xcode}
72b7576f 2===================
3
576f8b11 4This file describes steps to build OCCT libraries from a complete source package
5on Mac OS X with **Xcode**.
72b7576f 6
576f8b11 7If you build OCCT from bare sources (as in Git repository) or do some
72b7576f 8changes affecting CDL files, you need to use WOK to re-generate header files
ba06f8bb 9and build scripts / projects. See \ref occt_dev_guides__building_wok for instructions.
72b7576f 10
576f8b11 11Before building OCCT, you need to install the required third-party libraries; see
ba06f8bb 12paragraph 1 of \ref occt_dev_guides__building for details.
72b7576f 13
576f8b11 141. Add paths to the mandatory 3rd-party products (**Tcl/Tk** and **FreeType**)
15 in file *custom.sh* located in <i>\<OCCT_ROOT_DIR\> </i>. For this:
72b7576f 16
576f8b11 17 1.1. Add paths to the includes in variable *CSF_OPT_INC*;
72b7576f 18
576f8b11 19 1.2. Add paths to the binary libraries in variable *CSF_OPT_LIB64*;
72b7576f 20
21 All paths should be separated by ":" symbol.
22
576f8b11 232. Add paths to the optional 3rd-party libraries (**TBB, gl2ps** and **FreeImage**)
24 in the aforementioned environment variables *CSF_OPT_INC* and *CSF_OPT_LIB64* from file *custom.sh*.
72b7576f 25
576f8b11 26 If you want to build OCCT without the optional libraries perform the following steps:
72b7576f 27
576f8b11 28 2.1 Disable unnecessary library in *custom.sh* by setting the corresponding
29 variable <i>HAVE_<LIBRARY_NAME></i> to *false*.
30~~~~~
72b7576f 31 export HAVE_GL2PS=false
576f8b11 32~~~~~
72b7576f 33 2.2 Remove this library from Project navigator in Xcode for each project that
34 uses it: choose the required project, right click on the unnecessary
576f8b11 35 library and select **Delete** button.
72b7576f 36
373. Open Terminal application.
38
576f8b11 394. Enter <i>\<OCCT_ROOT_DIR\></i>:
40~~~~~
72b7576f 41 cd \<OCCT_ROOT_DIR\>
576f8b11 42~~~~~
435. To start **Xcode**, run command <i>/xcode.sh</i>
44
456. To build a certain toolkit, select it in **Scheme** drop-down list in Xcode
46 toolbar, press **Product** in the menu and click **Build** button.
47
48 To build the entire OCCT, create a new empty project (select **File ->
49 New -> Project -> "Empty project** in the menu. Input the project name,
50 e.g. *OCCT*, click **Next** and **Create** buttons). Drag and drop the *OCCT*
51 folder in the created *OCCT* project in the Project navigator. Select
52 **File -> New -> Target -> Aggregate** in the menu. Enter the project name
53 (e.g. <i>OCCT</i>) and click **Finish**. The **Build Phases** tab will open.
72b7576f 54 Click "+" button to add the necessary toolkits to the target project.
576f8b11 55 It is possible to select all toolkits by pressing **Command+A** combination.
72b7576f 56
576f8b11 57To start *DRAWEXE*, which has been built with Xcode on Mac OS X, perform the following steps:
72b7576f 58
576f8b11 591.Open Terminal application
72b7576f 60
576f8b11 612.Enter <i>\<OCCT_ROOT_DIR\></i>:
62~~~~~
72b7576f 63 cd \<OCCT_ROOT_DIR\>
576f8b11 64~~~~~
72b7576f 65
576f8b11 663.Run the script
67~~~~~
72b7576f 68 ./draw_cbp.sh xcd [d]
576f8b11 69~~~~~
70 Option *d* is used if OCCT has been built in **Debug** mode.