Open CASCADE Technology
Building with Xcode


This file describes steps to build OCCT libraries from sources on Mac OS X with Xcode projects, generated by OCCT legacy tool genproj.

Third-party libraries

Before building OCCT, make sure to have all the needed third-party libraries installed. On OS X we recommend to use native libraries. You can also build third-party libraries from their sources, see Building 3rd-party libraries on MacOS X for instructions.


Before building it is necessary to set up build environment.

The environment is defined in the file which can be edited directly:

  • Add paths to includes of used third-party libraries in variable CSF_OPT_INC (use colon ":" as path separator).
  • Add paths to their binary libraries in variable CSF_OPT_LIB64.
  • Set variable SHORTCUT_HEADERS to specify a method for population of folder inc by header files. Supported methods are:
    • Copy - headers will be copied from src;
    • ShortCut - short-cut header files will be created, redirecting to same-named header located in src;
    • "HardLink* - hard links to headers located in src will be created.
  • For optional third-party libraries, set corresponding environment variable HAVE_<LIBRARY_NAME> to either false, e.g.:
    export HAVE_FREEIMAGE=false

Alternatively, or when does not exist, you can launch to configure environment interactively:


Click "Save" to store the specified configuration in file.

Projects generation

Launch genproj tool to update content of inc folder and generate project files after changes in OCCT code affecting layout or composition of source files.

To use genproj and genconf tools you need to have Tcl installed and accessible by PATH.

For instance, in Terminal application:

$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj

Option -static can be used with XCode to build static libraries.

$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj xcd -static


To start Xcode, launch script

To build a certain toolkit, select it in Scheme drop-down list in Xcode toolbar, press Product in the menu and click Build button.

To build the entire OCCT:

  • 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).
  • Drag and drop the OCCT folder in the created OCCT project in the Project navigator.
  • Select File -> New -> Target -> Aggregate in the menu.
  • Enter the project name (e.g. OCCT) and click Finish. The Build Phases tab will open.
  • Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing Command+A combination.

Launching DRAW

To start DRAWEXE, which has been built with Xcode on Mac OS X, perform the following steps:

1.Open Terminal application

2.Enter <OCCT_ROOT_DIR>:


3.Run the script

./ xcd [d]

Option d is used if OCCT has been built in Debug mode.