Build Open CASCADE using CMake - Easy method

 Build Open CASCADE using CMake. 



This is the standard way to produce the binaries of Open CASCADE Technology (OCCT)

STEP 1 : Download and install CMake

First of all, you have to install CMake tool. That can be found here. Follow the instructions given on the page, download and install CMake.


STEP 2 : Get the source of OCCT

You can find the open cascade source here. You need to download the source code and extract it.


STEP 3 : Get additional 3rd party libraries

There is a list of 3rd party libraries that need to build the Open CASCADE. Some of them are mandatory and some of them are optional. You can find more details in Open CASCADE website


You can download each 3rd party library and build binaries. But the way I prefer most is to get the required binaries from the installer.

You can download the Open CASCADE installer and install it. In the installation directory, you can see the additional libraries. Copy them to a new folder for future use.


SETP 4 : Create folders

You need to create four (4) separate folders.

  1. 3rdpartylibs - includes all the required 3rd party libraries. Copy 3rd party libraries to this directory
  2. occt              - includes the source of Open CASCADE. Copy OCCT source to this directory
  3. occt install    - to store files after making the installer
  4. temp            - to store intermediate files 

STEP 5 - Open CMake


In the top field give the path to Open CASCADE source and give the path to store binaries. You can see the directory mentioned in the below image and follow the same process.

STEP 6 : Select the target Visual Studio version


You can specify what is the target Visual Studio version you are planning to work with,

It is not mandatory to change other parameters in the dialog box unless you have a clear understanding. For noobs, it is recommended to select only Visual Studio version.
After that click the "Generate" button in the CMake dialog box.

STEP 7 : Generate the binaries


After clicking the "Generate" button, you will end up with several errors.


To fix that you have to specify the 3rd party library directory here. If you cannot see the grouped list, you can select the check box at the top called "Grouped".


Set the install directory as shown in here.

If you want to build the binaries to use with VTK, enable the check box as shown in the following image.

Click "Generate" button again.

STEP 8 : Build the project


After completing the CMake process go to the occt-binary folder and open the Visual Studio solution file with the corresponding Visual Studio version.

Make sure you are in the Debug mode in the Visual Studio. Then first build the "ALL_BUILD". Then build "INSTALL".

Finally, you will end up with debug library files of the Open CASCADE.

Post a Comment

Previous Post Next Post