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