0029520: Visualization - drop deprecated V3d_View::Export() functionality and depende...
[occt.git] / dox / dev_guides / building / xcode.md
ba06f8bb 1Building with Xcode {#occt_dev_guides__building_xcode}
72b7576f 2===================
72c37458 4@tableofcontents
72b7576f 5
72c37458 6@section build_xcode_intro General
72b7576f 7
72c37458 8This file describes steps to build OCCT libraries from sources on Mac OS X with **Xcode** projects, generated by OCCT legacy tool **genproj**.
72b7576f 9
72c37458 10@section build_xcode_3rdparty Third-party libraries
72b7576f 11
72c37458 12Before building OCCT, make sure to have all the needed third-party libraries installed.
13On OS X we recommend to use native libraries.
14You can also build third-party libraries from their sources, see @ref occt_dev_guides__building_3rdparty_osx for instructions.
72b7576f 15
72c37458 16@section build_xcode_conf Configuration
72b7576f 17
72c37458 18Before building it is necessary to set up build environment.
72b7576f 19
72c37458 20The environment is defined in the file *custom.sh* which can be edited directly:
72b7576f 21
72c37458 22* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC* (use colon ":" as path separator).
23* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
5951a088 24* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
25 * *Copy* - headers will be copied from *src*;
26 * *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
27 * "HardLink* - hard links to headers located in *src* will be created.
72c37458 28* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
576f8b11 29~~~~~
e52ba46e 30 export HAVE_FREEIMAGE=false
576f8b11 31~~~~~
72b7576f 32
72c37458 33Alternatively, or when *custom.sh* does not exist, you can launch *genconf.sh* to configure environment interactively:
37Click "Save" to store the specified configuration in *custom.sh* file.
39@section build_xcode_gen Projects generation
41Launch **genproj** tool to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
43@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
45For instance, in Terminal application:
72b7576f 46
576f8b11 47~~~~~
72c37458 48 $ cd /dev/OCCT/opencascade-7.0.0
944d808c 49 $ ./genproj
576f8b11 50~~~~~
576f8b11 51
2e32a645 52Option **-static** can be used with XCode to build static libraries.
55 $ cd /dev/OCCT/opencascade-7.0.0
56 $ ./genproj xcd -static
72c37458 59@section build_xcode_build Building
61To start **Xcode**, launch script *xcode.sh*.
63To build a certain toolkit, select it in **Scheme** drop-down list in Xcode toolbar, press **Product** in the menu and click **Build** button.
576f8b11 64
72c37458 65To build the entire OCCT:
66* Create a new empty project (select **File -> New -> Project -> Empty project** in the menu; input the project name, e.g. *OCCT*; then click **Next** and **Create**).
67* Drag and drop the *OCCT* folder in the created *OCCT* project in the Project navigator.
68* Select **File -> New -> Target -> Aggregate** in the menu.
69* Enter the project name (e.g. *OCCT*) and click **Finish**. The **Build Phases** tab will open.
70* Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing **Command+A** combination.
72@section build_xcode_draw Launching DRAW
72b7576f 73
576f8b11 74To start *DRAWEXE*, which has been built with Xcode on Mac OS X, perform the following steps:
72b7576f 75
576f8b11 761.Open Terminal application
72b7576f 77
576f8b11 782.Enter <i>\<OCCT_ROOT_DIR\></i>:
72b7576f 80 cd \<OCCT_ROOT_DIR\>
576f8b11 81~~~~~
72b7576f 82
576f8b11 833.Run the script
72b7576f 85 ./draw_cbp.sh xcd [d]
576f8b11 86~~~~~
72c37458 87
88Option *d* is used if OCCT has been built in **Debug** mode.