Archicad C++ API
About Archicad add-on development using the C++ API.

Cross-platform add-on

stefan
Advisor
I know the Devkit contains a set of examples, but I'm struggling to make a Windows/OSX ready add-on project.

Is there a template possible to have a single folder with the add-on ready for Windows and OSX? Or how would you best manage a cross-platform add-on? I failed in adding the necessary files and scripts to an existing add-on from the Visual Studio example, to also contain the necessary OSX add-on files.

I guess that it should be possible to share the same source files mostly.
--- stefan boeykens --- bim-expert-architect-engineer-musician ---
Archicad28/Revit2024/Rhino8/Solibri/Zoom
MBP2023:14"M2MAX/Sequoia+Win11
Archicad-user since 1998
my Archicad Book
1 REPLY 1
Ralph Wessel
Mentor
stefan wrote:
I know the Devkit contains a set of examples, but I'm struggling to make a Windows/OSX ready add-on project.
Is there a template possible to have a single folder with the add-on ready for Windows and OSX? Or how would you best manage a cross-platform add-on? I failed in adding the necessary files and scripts to an existing add-on from the Visual Studio example, to also contain the necessary OSX add-on files.
I guess that it should be possible to share the same source files mostly.
The primary difference between a Mac and Windows development is the project file. The Mac version will be built with Xcode and the Windows version with Visual Studio. We follow the conventions in the GS Style Guide where the Mac project is in Make.mac and the Windows project in Make.win.

Although GS provides good cross-platform tools for handling resources, e.g. dialogs, strings etc, there are still minor platform-specific variations. Following the Style Guide again, we put these platform-specific resource files in RFIX.mac and RFIX.win.

Otherwise, all the source and resource files are common to both platforms (Src, RINT, RFIX). When a change is made, it automatically flows through to the builds for both platforms. There is no need to write code specific to each platform unless you need to go beyond the scope of the API (which is rare). It's unfortunate that the examples don't put the project files into Make.mac and Make.win folders, because a cross-platform merge would be really simple. If you move the project files into appropriate folders, you will need to adjust the paths in the project accordingly (to sources/resources/tools etc), but this is relatively straightforward.
Ralph Wessel BArch
Software Engineer Speckle Systems