This repo enables OpenCascade libraries to be compiled as DLLs and .lib files for x86 and x64 platforms (and others as required) so as to be compatible with xbim.Geometry, and appropriate for .NET nuget packaging in a fully repeatable manner for any OpenCascade release.
It's a simple wrapper around the standard 'cmake' mechanism which just ensures that we drive cmake to configure the builds consistently e.g.
- Disabling OCCT Modules we don't need (such as Visualisation)
- Ensuring exceptions are raised in Release builds
- Removing dependencies on unnecessary 3rd party packages such as FreeType
It does exactly the same as the cmake GUI but is a repeatable scripted process which should avoid mis-steps when regenerating OCCT libraries in future. Building and 'Installing' are done automatically after cmake has run.
The Nuget packaging project is also provided in Xbim.Geometry.Occt
The main entry point to build OpenCASCADE is xbim-build-and-install-all-platforms.cmd
.
Note: you must run this command from a 'Native x64' console so the correct VC paths are available.
This command will:
- configure each platform in turn with cmake
- compile for Release configuration
- deploy the binaries to the Install folder under the appropriate platform's bin/lib folder.
- Copy the headers to the Install folder.
The Install folder can then be used as the source when packing a Nuget package. To create a nuget package the resulting libs & dlls, simply build the Xbim.Geometry.Occt solution and the nuget package will be produced in the 'bin' folder.
Clean the Builds and Installs folders to avoid any inclusion of deleted content from other prior releases.
Download the latest OCCT zip/tar to this folder, unpack and update OCCT_SOURCEDIR in xbim-build-and-install-all-platforms.cmd
to point at the
new OCCT source.
Run xbim-configure.cmd
manually and open the cmake GUI to check all settings are as expected. Update xbim-configure.cmd
as appropriate
if there are new cmake flags to set. Run xbim-build-and-install-all-platforms.cmd
to build and compile all platforms into the Install folder
After OCCT has been built, review Occt.lib.targets in case any new or deprecated OCCT libs have been added,removed or renamed. Update the Xbim.Geometry.Occt package and version information.
There are no CI builds for this project given the infrequency of OCCT releases. Deployment to nuget its is currently manual.
The Building OpenCascade from Source using CMake and Visual Studio 2022 Word document is obsolete and for reference only
There are no OCCT third party dependencies needed, but the ThirdParty folder is left in case this changes.
This repo does not version the Open Casade source, but it does version the Build folders (which is largely .vcxproj, .sln and cmake files).
This is useful to determine any environmental changes between releases - or to track the impact of cmake
changes.