Open CASCADE Technology
6.7.0
|
|
This document presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform.
This guide assumfamiliar with MS Visual Studio / Visual C++.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
The links for downloading the third-party products are available on the web site of OPEN CASCADE SAS at http://www.opencascade.org/getocc/require/. There are two types of third-party products which are used by OCCT:
It is recommended to create a separate new folder on your workstation where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, c:\occ3rdparty).
Further in this document, this folder is referred to as 3rdparty.
Tcl/Tk is required for DRAW test harness.We recommend installing a binary distribution that could be downloaded from http://www.activestate.com/activetcl.
Go to "Free Downloads" and pick the version of the Install Wizard that matches your target platform – 32 bit (x86) or 64 bit (x64). The version of Visual Studio you use is irrelevant when choosing the Install Wizard.
Run the Install Wizard you downloaded, and install Tcl/Tk products
Further in this document, this folder is referred to as tcltk.
FreeType is required for display of text in 3D viewer. You can download its sources from http://sourceforge.net/projects/freetype/files/
The building process is the following:
Unpack the downloaded archive of FreeType product into the 3rdparty folder.
As a result, you should have a folder named for example, 3rdparty\freetype-2.4.10. Further in this document, this folder is referred to as freetype.
Build the freetype project.
As a result, you will get a freetype import library (.lib) in the freetype\obj\win32\vc20xx folder.
If you are building for 64 bit platform, start the Configuration Manager (Build - Configuration Manager), and add x64 platform to the solution configuration by copying the settings from Win32 platform:
Update the value of the Output File for x64 configuration:
Build the freetype project.
As a result, you should obtain a 64 bit import library (.lib) file in the freetype\x64\vc20xx folder.
If you want to build freetype as a dynamic library (.dll) follow items 6, 7 and 8 of this list.
Edit file freetype\include\freetype\config\ftoption.h:
in line 255, uncomment the definition of macro FT_EXPORT and change it as follows:
#define FT_EXPORT(x) __declspec(dllexport) x
Build the freetype project.
As a result, you should obtain import library (.lib) and dynamic library (.dll) files in freetype \objs\release or \objs\debug folders. If you are building for a 64 bit platform, follow item 5 of this list.
In order to facilitate use of the FreeType libraries in OCCT with minimal adjustment of its build procedures, it is recommended to copy the include files and libraries of FreeType to a separate folder, named according to the pattern: freetype-compiler-bitness-building mode where
The include subfolder should be copied as is, while libraries should be renamed to freetype.lib and freetype.dll (suffixes removed) and placed to subdirectories lib *and *bin, respectively. If Debug configuration is built, the Debug libraries should be put in subdirectories libd and bind.
This third-party product is installed with binaries from the archive that can be downloaded from http://threadingbuildingblocks.org/. Go to "Downloads page", find the release version you need (e.g. tbb30_018oss) and pick the archive for Windows platform. Unpack the downloaded archive of TBB product into the 3rdparty folder. Further in this document, this folder is referred to as tbb.
This third-party product should be built as a dynamically loadable library (dll file). You can download its sources from http://geuz.org/gl2ps/src/
The building process is the following:
Unpack the downloaded archive of gl2ps product (e.g. gl2ps-1.3.5.tgz) into the 3rdparty folder.
As a result, you should have a folder named for example, 3rdparty\gl2ps-1.3.5-source.
Rename it according to the rule: gl2ps-platform-compiler-building mode, where
Further in this document, this folder is referred to as gl2ps.
Edit the file gl2ps\CMakeLists.txt.
After line 113 in CMakeLists.txt:
set_target_properties(shared PROPERTIES COMPILE_FLAGS \"-DGL2PSDLL -DGL2PSDLL_EXPORTS\")
add the following line:
add_definitions(-D_USE_MATH_DEFINES)
Attention: If cygwin was installed on your computer make sure that there is no path to the latter in the PATH variable in order to avoid possible conflicts during the configuration.
Launch CMake (cmake-gui.exe) using the Program menu.
In CMake:
As a result, you should have the installed gl2ps product in the CMAKE_INSTALL_PREFIX path.
This third-party product should be built as a dynamically loadable library (.dll file). You can download its sources from http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
The building process is the following:
Unpack the downloaded archive of FreeImage product into 3rdparty folder.
As a result, you should have a folder named 3rdparty\FreeImage.
Rename it according to the rule: freeimage-platform-compiler-building mode, where
Further in this document, this folder is referred to as freeimage.
Open the solution file freeimage\FreeImage..sln* in Visual Studio that corresponds to the version of Visual Studio you use.
Since the version of Visual Studio you use is higher than VC++ 2008, apply conversion of the workspace. Such conversion should be suggested automatically by Visual Studio.
Select a configuration to build.
Note:
If you want to build a debug version of FreeImage binaries then you must rename the following files for projects FreeImage and FreeimagePlus:
Project-Properties-Configuration Properties-Linker-General-Output File
from FreeImage*d*.dll to FreeImage.dll from FreeImagePlus*d*.dll to FreeImagePlus.dll
Project-Properties-Configuration Properties-Linker-Debugging-Generate Program Database File
from FreeImage*d*.pdb to FreeImage.pdb from FreeImagePlus*d*.pdb to FreeImagePlus.pdb
Project-Properties-Configuration Properties-Linker-Advanced-Import Library
from FreeImage*d*.lib to FreeImage.lib from FreeImagePlus*d*.lib to FreeImagePlus.lib
Project-Properties-Configuration Properties-Build Events-Post-Build Event-Comand Line
from FreeImage*d*.dll to FreeImage.dll from FreeImage*d*.lib to FreeImage.lib from FreeImagePlus*d*.dll to FreeImagePlus.dll from FreeImagePlus*d*.lib to FreeImagePlus.lib
Additionally, for project FreeImagePlus rename: Project-Properties-Configuration Properties-Linker-Input-Additional Dependencies
from FreeImage*d*.lib to FreeImage.lib
Start the building process.
As a result, you should have the library files of FreeImage product in the freeimage\Dist folder (FreeImage.dll and FreeImage.lib files) and in the freeimage\Wrapper\FreeImagePlus\dist folder (FreeImagePlus.dll and FreeImagePlus.lib files).
If you have OpenCL SDK (one provided by Apple, AMD, NVIDIA, Intel, or other vendor) installed on your system, you should find OpenCL headers and libraries required for building OCCT inside that SDK.
Alternatively, you can use OpenCL ICD (Installable Client Driver) Loader provided by Khronos group. The following describes steps used to build OpenCL ICD Loader version 1.2.11.0.