2023-01-16 08:07 AM
How to start api (c++) in 26?
There was a template up to 25, but if it was changed to cmake, how should I start?
2023-01-16 09:08 PM
Searching this forum for 'cmake' gives a lot of results, but perhaps these two topics may answer your question:
https://community.graphisoft.com/t5/Developer-forum/CMake-Template-for-Archicad-Add-Ons/m-p/220809
https://community.graphisoft.com/t5/Developer-forum/CMAKE-ADDON/m-p/252101
2023-01-29 03:32 PM
thank you so much ^^.
zip file from https://github.com/GRAPHISOFT/archicad-addon-cmake-template
to C:\Users\----------------\Documents\Visual Studio 2019\Templates Can I just copy it to \ProjectTemplates\Visual C++ Project?
Can't find it?
1. Where should I copy it?
2. How to find it?
2023-02-09 03:34 PM
If you haven't already, install cmake 3.16+ and Python 2.7+ or 3.8+.
After that, create a directory called Build inside the extracted folder and start a command prompt inside that new folder. Input the command to generate the project using cmake.
The shortest version of that command would be something along the lines of:
cmake -G "Visual Studio 16 2019" -A "x64" -DAC_API_DEVKIT_DIR="Replace with the full path to your Archicad devkit Support folder" ..
You can add the optional parameters listed on the README of the cmake template repository in order to populate those settings when generating the project.
If you're using a different Visual Studio Version you can change the value of the -G parameter as per the cmake docs
Anyway, running this command will generate the project files. Bear in mind that while this will create Visual Studio project files (.proj) and a Visual Studio solution file (.sln), you should not open them directly on Visual Studio. What you should use instead is the built-in Visual Studio support for cmake.
In order to do that, you must have the C++ Cmake tools for Windows installed (you can install it through the Visual Studio Installer). After that is done, open Visual Studio and choose the option to open a local folder, pointing it to the project folder. If you've never worked with them together, you should check out the official docs about using cmake with Visual Studio.
That's the gist of it. There are some Visual Studio specific setup you can make to streamline some of that stuff (such as defining the API_DEVKIT var on the CmakeSettings.json that Visual Studio creates in order to build for different AC versions and so on), but that's something that depends on your own particular needs.