OSArch Community

Use a large C++ Library for Swift in Xcode: IfcOpenShell

  1. J

    Hi there,

    for a project of mine i really want to use the IfcOpenShell Library (https://github.com/IfcOpenShell/IfcOpenShell) which is a large C++ Library helping with Ifc-File Handling. It has lots of useful tools to convert ifc files and so on. I am normally into Apple Dev so please excuse logical mistakes in my questions.

    The problem i am facing is integrating IfcOpenShell with my Xcode project on an Apple Silicon Mac. Although i know that there are guides online that show how to integrate C++ in Xcode projects, it seems there are none explaining how to go from the initial project download to a shared library that can then be used in a Xcode project. So my questions are the following:

    1. I know that i want to use a shared library. How would i create one? With Cmake? How?

    2. If i created the Library how would i move on? Create a Xcode Project for the Library alone and then put it into a Workspace with the main App?

    3. How would i then call my functions? (I guess with a Bridging header and then just use the import in Swift)

    I have already installed IfcOpenShell on my machine and executed the steps as shown in the installation guide. https://blenderbim.org/docs-python/ifcopenshell/installation.html

    Would be very thankful for detailed answers that tell how to deal with my Situation and how to move on.

    Thank you very much :)

Login or Register to reply.